Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aa2faab1
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aa2faab1
编写于
5月 18, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feature/TD-13066-3.0
上级
f41caed1
fc360ffc
变更
58
显示空白变更内容
内联
并排
Showing
58 changed file
with
1827 addition
and
1410 deletion
+1827
-1410
example/src/tmq.c
example/src/tmq.c
+2
-2
include/common/tmsgcb.h
include/common/tmsgcb.h
+3
-3
include/common/ttypes.h
include/common/ttypes.h
+2
-0
include/libs/nodes/nodes.h
include/libs/nodes/nodes.h
+1
-0
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+1
-0
include/libs/qcom/query.h
include/libs/qcom/query.h
+15
-15
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/common/src/tmsgcb.c
source/common/src/tmsgcb.c
+14
-14
source/dnode/mgmt/mgmt_bnode/src/bmWorker.c
source/dnode/mgmt/mgmt_bnode/src/bmWorker.c
+2
-2
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+3
-4
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
+2
-2
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+23
-16
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
+4
-4
source/dnode/mgmt/mgmt_snode/src/smWorker.c
source/dnode/mgmt/mgmt_snode/src/smWorker.c
+6
-6
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+32
-44
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+8
-9
source/dnode/mgmt/node_mgmt/src/dmNodes.c
source/dnode/mgmt/node_mgmt/src/dmNodes.c
+7
-6
source/dnode/mgmt/node_mgmt/src/dmProc.c
source/dnode/mgmt/node_mgmt/src/dmProc.c
+3
-3
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+3
-64
source/dnode/mnode/impl/inc/mndVgroup.h
source/dnode/mnode/impl/inc/mndVgroup.h
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+17
-40
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+1
-2
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+11
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+7
-7
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+3
-5
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+12
-11
source/dnode/mnode/impl/test/trans/trans2.cpp
source/dnode/mnode/impl/test/trans/trans2.cpp
+1
-1
source/dnode/vnode/src/inc/tq.h
source/dnode/vnode/src/inc/tq.h
+1
-0
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+6
-3
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+3
-0
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+24
-3
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/executor/src/executorMain.c
source/libs/executor/src/executorMain.c
+1
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+13
-22
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+119
-1
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+185
-11
source/libs/function/inc/builtinsimpl.h
source/libs/function/inc/builtinsimpl.h
+1
-0
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+8
-5
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+58
-7
source/libs/function/src/tudf.c
source/libs/function/src/tudf.c
+36
-26
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+1
-0
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+6
-3
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+18
-2
source/libs/parser/src/parUtil.c
source/libs/parser/src/parUtil.c
+2
-0
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+886
-880
source/libs/parser/test/parSelectTest.cpp
source/libs/parser/test/parSelectTest.cpp
+6
-0
source/libs/planner/inc/planInt.h
source/libs/planner/inc/planInt.h
+7
-6
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+4
-8
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+50
-26
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+71
-37
source/libs/planner/test/planJoinTest.cpp
source/libs/planner/test/planJoinTest.cpp
+8
-0
source/libs/planner/test/planSetOpTest.cpp
source/libs/planner/test/planSetOpTest.cpp
+24
-2
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+51
-53
source/libs/tdb/inc/tdb.h
source/libs/tdb/inc/tdb.h
+28
-28
source/libs/tdb/src/db/tdbDb.c
source/libs/tdb/src/db/tdbDb.c
+11
-11
source/libs/tdb/src/db/tdbTable.c
source/libs/tdb/src/db/tdbTable.c
+3
-3
source/libs/tdb/src/inc/tdbInt.h
source/libs/tdb/src/inc/tdbInt.h
+2
-2
tests/script/tsim/tstream/basic1.sim
tests/script/tsim/tstream/basic1.sim
+8
-8
未找到文件。
example/src/tmq.c
浏览文件 @
aa2faab1
...
...
@@ -106,8 +106,8 @@ int32_t create_topic() {
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create topic topic_ctb_column as abc1"
);
/*pRes = taos_query(pConn, "create topic topic_ctb_column as select ts, c1, c2, c3 from st1");*/
/*pRes = taos_query(pConn, "create topic topic_ctb_column as abc1");*/
pRes
=
taos_query
(
pConn
,
"create topic topic_ctb_column as select ts, c1, c2, c3 from st1"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create topic topic_ctb_column, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
...
...
include/common/tmsgcb.h
浏览文件 @
aa2faab1
...
...
@@ -60,9 +60,9 @@ typedef struct {
ReportStartup
reportStartupFp
;
}
SMsgCb
;
void
tmsgSetDefault
MsgCb
(
const
SMsgCb
*
pMsgC
b
);
int32_t
tmsgPutToQueue
(
const
SMsgCb
*
pMsgC
b
,
EQueueType
qtype
,
SRpcMsg
*
pMsg
);
int32_t
tmsgGetQueueSize
(
const
SMsgCb
*
pMsgC
b
,
int32_t
vgId
,
EQueueType
qtype
);
void
tmsgSetDefault
(
const
SMsgCb
*
msgc
b
);
int32_t
tmsgPutToQueue
(
const
SMsgCb
*
msgc
b
,
EQueueType
qtype
,
SRpcMsg
*
pMsg
);
int32_t
tmsgGetQueueSize
(
const
SMsgCb
*
msgc
b
,
int32_t
vgId
,
EQueueType
qtype
);
int32_t
tmsgSendReq
(
const
SEpSet
*
epSet
,
SRpcMsg
*
pMsg
);
void
tmsgSendRsp
(
SRpcMsg
*
pMsg
);
void
tmsgSendRedirectRsp
(
SRpcMsg
*
pMsg
,
const
SEpSet
*
pNewEpSet
);
...
...
include/common/ttypes.h
浏览文件 @
aa2faab1
...
...
@@ -179,6 +179,8 @@ typedef struct {
} \
} while (0)
//TODO: use varchar(0) to represent NULL type
#define IS_NULL_TYPE(_t) ((_t) == TSDB_DATA_TYPE_NULL)
#define IS_SIGNED_NUMERIC_TYPE(_t) ((_t) >= TSDB_DATA_TYPE_TINYINT && (_t) <= TSDB_DATA_TYPE_BIGINT)
#define IS_UNSIGNED_NUMERIC_TYPE(_t) ((_t) >= TSDB_DATA_TYPE_UTINYINT && (_t) <= TSDB_DATA_TYPE_UBIGINT)
#define IS_FLOAT_TYPE(_t) ((_t) == TSDB_DATA_TYPE_FLOAT || (_t) == TSDB_DATA_TYPE_DOUBLE)
...
...
include/libs/nodes/nodes.h
浏览文件 @
aa2faab1
...
...
@@ -208,6 +208,7 @@ typedef enum ENodeType {
QUERY_NODE_PHYSICAL_PLAN_SORT
,
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL
,
QUERY_NODE_PHYSICAL_PLAN_FILL
,
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
,
QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW
,
...
...
include/libs/nodes/querynodes.h
浏览文件 @
aa2faab1
...
...
@@ -248,6 +248,7 @@ typedef struct SSetOperator {
SNode
*
pRight
;
SNodeList
*
pOrderByList
;
// SOrderByExprNode
SNode
*
pLimit
;
char
stmtName
[
TSDB_TABLE_NAME_LEN
];
}
SSetOperator
;
typedef
enum
ESqlClause
{
...
...
include/libs/qcom/query.h
浏览文件 @
aa2faab1
...
...
@@ -223,19 +223,19 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t
#define qDebug(...) \
do { \
if (qDebugFlag & DEBUG_DEBUG) { \
taosPrintLog("QRY ", DEBUG_DEBUG,
tsLogEmbedded ? 255 :
qDebugFlag, __VA_ARGS__); \
taosPrintLog("QRY ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); \
} \
} while (0)
#define qTrace(...) \
do { \
if (qDebugFlag & DEBUG_TRACE) { \
taosPrintLog("QRY ", DEBUG_TRACE,
tsLogEmbedded ? 255 :
qDebugFlag, __VA_ARGS__); \
taosPrintLog("QRY ", DEBUG_TRACE, qDebugFlag, __VA_ARGS__); \
} \
} while (0)
#define qDebugL(...) \
do { \
if (qDebugFlag & DEBUG_DEBUG) { \
taosPrintLongString("QRY ", DEBUG_DEBUG,
tsLogEmbedded ? 255 :
qDebugFlag, __VA_ARGS__); \
taosPrintLongString("QRY ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); \
} \
} while (0)
...
...
include/util/taoserror.h
浏览文件 @
aa2faab1
...
...
@@ -646,6 +646,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_PAR_INVALID_ALTER_TABLE TAOS_DEF_ERROR_CODE(0, 0x2649)
#define TSDB_CODE_PAR_CANNOT_DROP_PRIMARY_KEY TAOS_DEF_ERROR_CODE(0, 0x264A)
#define TSDB_CODE_PAR_INVALID_MODIFY_COL TAOS_DEF_ERROR_CODE(0, 0x264B)
#define TSDB_CODE_PAR_INVALID_TBNAME TAOS_DEF_ERROR_CODE(0, 0x264C)
//planner
#define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700)
...
...
source/common/src/tmsgcb.c
浏览文件 @
aa2faab1
...
...
@@ -17,46 +17,46 @@
#include "tmsgcb.h"
#include "taoserror.h"
static
SMsgCb
tsD
efaultMsgCb
;
static
SMsgCb
d
efaultMsgCb
;
void
tmsgSetDefault
MsgCb
(
const
SMsgCb
*
pMsgCb
)
{
tsDefaultMsgCb
=
*
pMsgC
b
;
}
void
tmsgSetDefault
(
const
SMsgCb
*
msgcb
)
{
defaultMsgCb
=
*
msgc
b
;
}
int32_t
tmsgPutToQueue
(
const
SMsgCb
*
pMsgC
b
,
EQueueType
qtype
,
SRpcMsg
*
pMsg
)
{
PutToQueueFp
fp
=
pMsgC
b
->
queueFps
[
qtype
];
return
(
*
fp
)(
pMsgC
b
->
mgmt
,
pMsg
);
int32_t
tmsgPutToQueue
(
const
SMsgCb
*
msgc
b
,
EQueueType
qtype
,
SRpcMsg
*
pMsg
)
{
PutToQueueFp
fp
=
msgc
b
->
queueFps
[
qtype
];
return
(
*
fp
)(
msgc
b
->
mgmt
,
pMsg
);
}
int32_t
tmsgGetQueueSize
(
const
SMsgCb
*
pMsgC
b
,
int32_t
vgId
,
EQueueType
qtype
)
{
GetQueueSizeFp
fp
=
pMsgC
b
->
qsizeFp
;
return
(
*
fp
)(
pMsgC
b
->
mgmt
,
vgId
,
qtype
);
int32_t
tmsgGetQueueSize
(
const
SMsgCb
*
msgc
b
,
int32_t
vgId
,
EQueueType
qtype
)
{
GetQueueSizeFp
fp
=
msgc
b
->
qsizeFp
;
return
(
*
fp
)(
msgc
b
->
mgmt
,
vgId
,
qtype
);
}
int32_t
tmsgSendReq
(
const
SEpSet
*
epSet
,
SRpcMsg
*
pMsg
)
{
SendReqFp
fp
=
tsD
efaultMsgCb
.
sendReqFp
;
SendReqFp
fp
=
d
efaultMsgCb
.
sendReqFp
;
return
(
*
fp
)(
epSet
,
pMsg
);
}
void
tmsgSendRsp
(
SRpcMsg
*
pMsg
)
{
SendRspFp
fp
=
tsD
efaultMsgCb
.
sendRspFp
;
SendRspFp
fp
=
d
efaultMsgCb
.
sendRspFp
;
return
(
*
fp
)(
pMsg
);
}
void
tmsgSendRedirectRsp
(
SRpcMsg
*
pMsg
,
const
SEpSet
*
pNewEpSet
)
{
SendRedirectRspFp
fp
=
tsD
efaultMsgCb
.
sendRedirectRspFp
;
SendRedirectRspFp
fp
=
d
efaultMsgCb
.
sendRedirectRspFp
;
(
*
fp
)(
pMsg
,
pNewEpSet
);
}
void
tmsgRegisterBrokenLinkArg
(
SRpcMsg
*
pMsg
)
{
RegisterBrokenLinkArgFp
fp
=
tsD
efaultMsgCb
.
registerBrokenLinkArgFp
;
RegisterBrokenLinkArgFp
fp
=
d
efaultMsgCb
.
registerBrokenLinkArgFp
;
(
*
fp
)(
pMsg
);
}
void
tmsgReleaseHandle
(
SRpcHandleInfo
*
pHandle
,
int8_t
type
)
{
ReleaseHandleFp
fp
=
tsD
efaultMsgCb
.
releaseHandleFp
;
ReleaseHandleFp
fp
=
d
efaultMsgCb
.
releaseHandleFp
;
(
*
fp
)(
pHandle
,
type
);
}
void
tmsgReportStartup
(
const
char
*
name
,
const
char
*
desc
)
{
ReportStartup
fp
=
tsD
efaultMsgCb
.
reportStartupFp
;
ReportStartup
fp
=
d
efaultMsgCb
.
reportStartupFp
;
(
*
fp
)(
name
,
desc
);
}
\ No newline at end of file
source/dnode/mgmt/mgmt_bnode/src/bmWorker.c
浏览文件 @
aa2faab1
...
...
@@ -38,9 +38,9 @@ static void bmSendErrorRsps(STaosQall *qall, int32_t numOfMsgs, int32_t code) {
static
inline
void
bmSendRsp
(
SRpcMsg
*
pMsg
,
int32_t
code
)
{
SRpcMsg
rsp
=
{
.
code
=
code
,
.
info
=
pMsg
->
info
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
contLen
=
pMsg
->
info
.
rspLen
,
.
info
=
pMsg
->
info
,
};
tmsgSendRsp
(
&
rsp
);
}
...
...
@@ -63,7 +63,7 @@ static void bmProcessMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
bmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pRpc
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
浏览文件 @
aa2faab1
...
...
@@ -86,7 +86,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
SRpcMsg
rpcMsg
=
{.
pCont
=
pHead
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_STATUS
,
.
info
.
ahandle
=
(
void
*
)
0x9527
};
SRpcMsg
rpcRsp
=
{
0
};
dTrace
(
"send status msg to mnode
, app:%p"
,
rpcMsg
.
info
.
ahandle
);
dTrace
(
"send status msg to mnode
"
);
SEpSet
epSet
=
{
0
};
dmGetMnodeEpSet
(
pMgmt
->
pData
,
&
epSet
);
...
...
@@ -116,8 +116,7 @@ static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) {
SServerStatusRsp
statusRsp
=
{
0
};
SMonMloadInfo
minfo
=
{
0
};
dmGetMnodeLoads
(
pMgmt
,
&
minfo
);
if
(
minfo
.
isMnode
&&
minfo
.
load
.
syncState
!=
TAOS_SYNC_STATE_LEADER
&&
minfo
.
load
.
syncState
!=
TAOS_SYNC_STATE_CANDIDATE
)
{
if
(
minfo
.
isMnode
&&
minfo
.
load
.
syncState
==
TAOS_SYNC_STATE_ERROR
)
{
pStatus
->
statusCode
=
TSDB_SRV_STATUS_SERVICE_DEGRADED
;
snprintf
(
pStatus
->
details
,
sizeof
(
pStatus
->
details
),
"mnode sync state is %s"
,
syncStr
(
minfo
.
load
.
syncState
));
return
;
...
...
@@ -127,7 +126,7 @@ static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) {
dmGetVnodeLoads
(
pMgmt
,
&
vinfo
);
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
vinfo
.
pVloads
);
++
i
)
{
SVnodeLoad
*
pLoad
=
taosArrayGet
(
vinfo
.
pVloads
,
i
);
if
(
pLoad
->
syncState
!=
TAOS_SYNC_STATE_LEADER
&&
pLoad
->
syncState
!=
TAOS_SYNC_STATE_FOLLOWE
R
)
{
if
(
pLoad
->
syncState
==
TAOS_SYNC_STATE_ERRO
R
)
{
pStatus
->
statusCode
=
TSDB_SRV_STATUS_SERVICE_DEGRADED
;
snprintf
(
pStatus
->
details
,
sizeof
(
pStatus
->
details
),
"vnode:%d sync state is %s"
,
pLoad
->
vgId
,
syncStr
(
pLoad
->
syncState
));
...
...
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
浏览文件 @
aa2faab1
...
...
@@ -153,14 +153,14 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
SRpcMsg
rsp
=
{
.
code
=
code
,
.
info
=
pMsg
->
info
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
contLen
=
pMsg
->
info
.
rspLen
,
.
info
=
pMsg
->
info
,
};
rpcSendResponse
(
&
rsp
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
aa2faab1
...
...
@@ -19,9 +19,9 @@
static
inline
void
mmSendRsp
(
SRpcMsg
*
pMsg
,
int32_t
code
)
{
SRpcMsg
rsp
=
{
.
code
=
code
,
.
info
=
pMsg
->
info
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
contLen
=
pMsg
->
info
.
rspLen
,
.
info
=
pMsg
->
info
,
};
tmsgSendRsp
(
&
rsp
);
}
...
...
@@ -29,7 +29,7 @@ static inline void mmSendRsp(SRpcMsg *pMsg, int32_t code) {
static
void
mmProcessQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from mnode queue
, type:%s"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
)
);
dTrace
(
"msg:%p, get from mnode queue
"
,
pMsg
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_DND_ALTER_MNODE
:
...
...
@@ -51,7 +51,7 @@ static void mmProcessQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
mmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -73,7 +73,7 @@ static void mmProcessQueryQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
}
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -84,13 +84,20 @@ static int32_t mmPutNodeMsgToWorker(SSingleWorker *pWorker, SRpcMsg *pMsg) {
return
0
;
}
int32_t
mmPutNodeMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
writeWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
writeWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
readWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
readWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
queryWorker
,
pMsg
);
int32_t
mmPutNodeMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
queryWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToMonitorQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
...
...
@@ -101,25 +108,25 @@ static inline int32_t mmPutRpcMsgToWorker(SSingleWorker *pWorker, SRpcMsg *pRpc)
SRpcMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
),
RPC_QITEM
);
if
(
pMsg
==
NULL
)
return
-
1
;
dTrace
(
"msg:%p,
is created
and put into worker:%s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
create
and put into worker:%s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
));
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
int32_t
mmPutRpcMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
queryWorker
,
p
Rpc
);
int32_t
mmPutRpcMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
queryWorker
,
p
Msg
);
}
int32_t
mmPutRpcMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
writeWorker
,
p
Rpc
);
int32_t
mmPutRpcMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
writeWorker
,
p
Msg
);
}
int32_t
mmPutRpcMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
readWorker
,
p
Rpc
);
int32_t
mmPutRpcMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
readWorker
,
p
Msg
);
}
int32_t
mmPutMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Rpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
syncWorker
,
pRpc
);
}
int32_t
mmPutMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
p
Msg
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
SSingleWorkerCfg
qCfg
=
{
...
...
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
浏览文件 @
aa2faab1
...
...
@@ -44,7 +44,7 @@ static void qmProcessMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
qmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pRpc
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -60,7 +60,7 @@ static void qmProcessQueryQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
qmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -76,7 +76,7 @@ static void qmProcessFetchQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
qmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -105,7 +105,7 @@ static int32_t qmPutRpcMsgToWorker(SQnodeMgmt *pMgmt, SSingleWorker *pWorker, SR
return
-
1
;
}
dTrace
(
"msg:%p,
is created
and put into worker:%s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
create
and put into worker:%s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
));
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
...
...
source/dnode/mgmt/mgmt_snode/src/smWorker.c
浏览文件 @
aa2faab1
...
...
@@ -19,9 +19,9 @@
static
inline
void
smSendRsp
(
SRpcMsg
*
pMsg
,
int32_t
code
)
{
SRpcMsg
rsp
=
{
.
code
=
code
,
.
info
=
pMsg
->
info
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
contLen
=
pMsg
->
info
.
rspLen
,
.
info
=
pMsg
->
info
,
};
tmsgSendRsp
(
&
rsp
);
}
...
...
@@ -44,7 +44,7 @@ static void smProcessMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
smSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pRpc
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -166,7 +166,7 @@ int32_t smPutNodeMsgToMgmtQueue(SSnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
dTrace
(
"msg:%p, put into worker
:
%s"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p, put into worker
%s"
,
pMsg
,
pWorker
->
name
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
@@ -174,7 +174,7 @@ int32_t smPutNodeMsgToMgmtQueue(SSnodeMgmt *pMgmt, SRpcMsg *pMsg) {
int32_t
smPutNodeMsgToMonitorQueue
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SSingleWorker
*
pWorker
=
&
pMgmt
->
monitorWorker
;
dTrace
(
"msg:%p, put into worker
:
%s"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p, put into worker
%s"
,
pMsg
,
pWorker
->
name
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
@@ -187,7 +187,7 @@ int32_t smPutNodeMsgToUniqueQueue(SSnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
dTrace
(
"msg:%p, put into worker
:
%s"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p, put into worker
%s"
,
pMsg
,
pWorker
->
name
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
@@ -195,7 +195,7 @@ int32_t smPutNodeMsgToUniqueQueue(SSnodeMgmt *pMgmt, SRpcMsg *pMsg) {
int32_t
smPutNodeMsgToSharedQueue
(
SSnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SSingleWorker
*
pWorker
=
&
pMgmt
->
sharedWorker
;
dTrace
(
"msg:%p, put into worker
:
%s"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p, put into worker
%s"
,
pMsg
,
pWorker
->
name
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
aa2faab1
...
...
@@ -51,7 +51,7 @@ static void vmProcessMgmtMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
break
;
default:
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
dError
(
"msg:%p, not processed in vnode
-mgmt/monitor
queue"
,
pMsg
);
dError
(
"msg:%p, not processed in vnode queue"
,
pMsg
);
}
if
(
msgType
&
1u
)
{
...
...
@@ -59,7 +59,7 @@ static void vmProcessMgmtMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
vmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -67,13 +67,13 @@ static void vmProcessMgmtMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
static
void
vmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p,
will be processed in
vnode-query queue"
,
pMsg
);
dTrace
(
"msg:%p,
get from
vnode-query queue"
,
pMsg
);
int32_t
code
=
vnodeProcessQueryMsg
(
pVnode
->
pImpl
,
pMsg
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
vmSendRsp
(
pMsg
,
code
);
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -82,13 +82,13 @@ static void vmProcessQueryQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
static
void
vmProcessFetchQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p,
will be processed in
vnode-fetch queue"
,
pMsg
);
dTrace
(
"msg:%p,
get from
vnode-fetch queue"
,
pMsg
);
int32_t
code
=
vnodeProcessFetchMsg
(
pVnode
->
pImpl
,
pMsg
,
pInfo
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
vmSendRsp
(
pMsg
,
code
);
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -96,7 +96,6 @@ static void vmProcessFetchQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
static
void
vmProcessWriteQueue
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
SRpcMsg
rsp
;
SArray
*
pArray
=
taosArrayInit
(
numOfMsgs
,
sizeof
(
SRpcMsg
*
));
if
(
pArray
==
NULL
)
{
...
...
@@ -108,7 +107,7 @@ static void vmProcessWriteQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
SRpcMsg
*
pMsg
=
NULL
;
if
(
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
)
==
0
)
continue
;
dTrace
(
"msg:%p,
will be processed in
vnode-write queue"
,
pMsg
);
dTrace
(
"msg:%p,
get from
vnode-write queue"
,
pMsg
);
if
(
taosArrayPush
(
pArray
,
&
pMsg
)
==
NULL
)
{
dTrace
(
"msg:%p, failed to process since %s"
,
pMsg
,
terrstr
());
vmSendRsp
(
pMsg
,
TSDB_CODE_OUT_OF_MEMORY
);
...
...
@@ -116,21 +115,12 @@ static void vmProcessWriteQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
}
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
pArray
);
i
++
)
{
SRpcMsg
*
pMsg
;
SRpcMsg
*
pRpc
;
pMsg
=
*
(
SRpcMsg
**
)
taosArrayGet
(
pArray
,
i
);
pRpc
=
pMsg
;
rsp
.
info
=
pRpc
->
info
;
rsp
.
pCont
=
NULL
;
rsp
.
contLen
=
0
;
SRpcMsg
*
pMsg
=
*
(
SRpcMsg
**
)
taosArrayGet
(
pArray
,
i
);
SRpcMsg
rsp
=
{.
info
=
pMsg
->
info
,
.
pCont
=
NULL
,
.
contLen
=
0
};
int32_t
ret
=
syncPropose
(
vnodeGetSyncHandle
(
pVnode
->
pImpl
),
p
Rpc
,
false
);
int32_t
ret
=
syncPropose
(
vnodeGetSyncHandle
(
pVnode
->
pImpl
),
p
Msg
,
false
);
if
(
ret
==
TAOS_SYNC_PROPOSE_NOT_LEADER
)
{
// rsp.code = TSDB_CODE_SYN_NOT_LEADER;
// tmsgSendRsp(&rsp);
dTrace
(
"syncPropose not leader redirect, vgId:%d "
,
syncGetVgId
(
vnodeGetSyncHandle
(
pVnode
->
pImpl
)));
dTrace
(
"msg:%p, is redirect since not leader, vgId:%d "
,
pMsg
,
pVnode
->
vgId
);
rsp
.
code
=
TSDB_CODE_RPC_REDIRECT
;
SEpSet
newEpSet
;
syncGetEpSet
(
vnodeGetSyncHandle
(
pVnode
->
pImpl
),
&
newEpSet
);
...
...
@@ -181,7 +171,7 @@ static void vmProcessApplyQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
// apply data into tsdb
if
(
vnodeProcessWriteReq
(
pVnode
->
pImpl
,
&
originalRpcMsg
,
pSyncApplyMsg
->
fsmMeta
.
index
,
&
rsp
)
<
0
)
{
rsp
.
code
=
terrno
;
dTrace
(
"
vnodeProcessWriteReq error, code:%d"
,
terrno
);
dTrace
(
"
msg:%p, process write error since %s"
,
pMsg
,
terrstr
()
);
}
syncApplyMsgDestroy
(
pSyncApplyMsg
);
...
...
@@ -215,7 +205,7 @@ static void vmProcessSyncQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numOf
SRpcMsg
rsp
=
{
0
};
rsp
.
code
=
terrno
;
rsp
.
info
=
pMsg
->
info
;
dTrace
(
"
vmProcessSyncQueue error, code:%d"
,
terrno
);
dTrace
(
"
msg:%p, process sync queue error since code:%s"
,
pMsg
,
terrstr
()
);
tmsgSendRsp
(
&
rsp
);
}
}
...
...
@@ -232,13 +222,13 @@ static void vmProcessMergeQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
);
dTrace
(
"msg:%p,
will be processed in
vnode-merge queue"
,
pMsg
);
dTrace
(
"msg:%p,
get from
vnode-merge queue"
,
pMsg
);
int32_t
code
=
vnodeProcessFetchMsg
(
pVnode
->
pImpl
,
pMsg
,
pInfo
);
if
(
code
!=
0
)
{
if
(
terrno
!=
0
)
code
=
terrno
;
vmSendRsp
(
pMsg
,
code
);
dTrace
(
"msg:%p, is freed,
result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
)
);
dTrace
(
"msg:%p, is freed,
code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
@@ -255,29 +245,29 @@ static int32_t vmPutNodeMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
{
dError
(
"vgId:%d, failed to
write msg:%p
to vnode-queue since %s"
,
pHead
->
vgId
,
pMsg
,
terrstr
());
dError
(
"vgId:%d, failed to
put msg:%p in
to vnode-queue since %s"
,
pHead
->
vgId
,
pMsg
,
terrstr
());
return
terrno
!=
0
?
terrno
:
-
1
;
}
switch
(
qtype
)
{
case
QUERY_QUEUE
:
dTrace
(
"msg:%p,
type:%s will be written into vnode-query queue
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
put into vnode-query worker, type:%s
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
taosWriteQitem
(
pVnode
->
pQueryQ
,
pMsg
);
break
;
case
FETCH_QUEUE
:
dTrace
(
"msg:%p,
type:%s will be written into vnode-fetch queue
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
put into vnode-fetch worker, type:%s
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
taosWriteQitem
(
pVnode
->
pFetchQ
,
pMsg
);
break
;
case
WRITE_QUEUE
:
dTrace
(
"msg:%p,
type:%s will be written into vnode-write queue
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
put into vnode-write worker, type:%s
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
taosWriteQitem
(
pVnode
->
pWriteQ
,
pMsg
);
break
;
case
SYNC_QUEUE
:
dTrace
(
"msg:%p,
type:%s will be written into vnode-sync queue
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
put into vnode-sync worker, type:%s
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
taosWriteQitem
(
pVnode
->
pSyncQ
,
pMsg
);
break
;
case
MERGE_QUEUE
:
dTrace
(
"msg:%p,
type:%s will be written into vnode-merge queue
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
dTrace
(
"msg:%p,
put into vnode-merge worker, type:%s
"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
taosWriteQitem
(
pVnode
->
pMergeQ
,
pMsg
);
break
;
default:
...
...
@@ -312,7 +302,7 @@ int32_t vmPutNodeMsgToMergeQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
int32_t
vmPutNodeMsgToMgmtQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SSingleWorker
*
pWorker
=
&
pMgmt
->
mgmtWorker
;
dTrace
(
"msg:%p,
will be put into vnode-mgmt queue, worker:%s"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p,
put into vnode-mgmt worker, type:%s"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
)
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
@@ -320,7 +310,7 @@ int32_t vmPutNodeMsgToMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
int32_t
vmPutNodeMsgToMonitorQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SSingleWorker
*
pWorker
=
&
pMgmt
->
monitorWorker
;
dTrace
(
"msg:%p,
will be put into vnode-monitor queue, worker:%s"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p,
put into vnode-monitor worker, type:%s"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
)
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
@@ -335,32 +325,30 @@ static int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pRpc, EQueueType q
int32_t
code
=
0
;
if
(
pMsg
!=
NULL
)
{
dTrace
(
"msg:%p, is created, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
));
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
// if (pMsg->handle != NULL) assert(pMsg->refId != 0);
switch
(
qtype
)
{
case
WRITE_QUEUE
:
dTrace
(
"msg:%p,
will be put into vnode-write queue"
,
pMsg
);
dTrace
(
"msg:%p,
create and put into vnode-write worker, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
taosWriteQitem
(
pVnode
->
pWriteQ
,
pMsg
);
break
;
case
QUERY_QUEUE
:
dTrace
(
"msg:%p,
will be put into vnode-query queue"
,
pMsg
);
dTrace
(
"msg:%p,
create and put into vnode-query queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
taosWriteQitem
(
pVnode
->
pQueryQ
,
pMsg
);
break
;
case
FETCH_QUEUE
:
dTrace
(
"msg:%p,
will be put into vnode-fetch queue"
,
pMsg
);
dTrace
(
"msg:%p,
create and put into vnode-fetch queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
taosWriteQitem
(
pVnode
->
pFetchQ
,
pMsg
);
break
;
case
APPLY_QUEUE
:
dTrace
(
"msg:%p,
will be put into vnode-apply queue"
,
pMsg
);
dTrace
(
"msg:%p,
create and put into vnode-apply queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
taosWriteQitem
(
pVnode
->
pApplyQ
,
pMsg
);
break
;
case
MERGE_QUEUE
:
dTrace
(
"msg:%p,
will be put into vnode-merge queue"
,
pMsg
);
dTrace
(
"msg:%p,
create and put into vnode-merge queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
taosWriteQitem
(
pVnode
->
pMergeQ
,
pMsg
);
break
;
case
SYNC_QUEUE
:
dTrace
(
"msg:%p,
will be put into vnode-sync queue"
,
pMsg
);
dTrace
(
"msg:%p,
create and put into vnode-sync queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pRpc
->
msgType
)
);
taosWriteQitem
(
pVnode
->
pSyncQ
,
pMsg
);
break
;
default:
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
aa2faab1
...
...
@@ -274,25 +274,24 @@ static void dmGetServerStartupStatus(SDnode *pDnode, SServerStatusRsp *pStatus)
}
}
void
dmProcessNetTestReq
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Req
)
{
dDebug
(
"
net test req is received"
);
SRpcMsg
rsp
=
{.
code
=
0
,
.
info
=
p
Req
->
info
};
rsp
.
pCont
=
rpcMallocCont
(
p
Req
->
contLen
);
void
dmProcessNetTestReq
(
SDnode
*
pDnode
,
SRpcMsg
*
p
Msg
)
{
dDebug
(
"
msg:%p, net test req will be processed"
,
pMsg
);
SRpcMsg
rsp
=
{.
code
=
0
,
.
info
=
p
Msg
->
info
};
rsp
.
pCont
=
rpcMallocCont
(
p
Msg
->
contLen
);
if
(
rsp
.
pCont
==
NULL
)
{
rsp
.
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
else
{
rsp
.
contLen
=
p
Req
->
contLen
;
rsp
.
contLen
=
p
Msg
->
contLen
;
}
rpcSendResponse
(
&
rsp
);
}
void
dmProcessServerStartupStatus
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
dDebug
(
"server startup status req is received"
);
void
dmProcessServerStartupStatus
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
dDebug
(
"msg:%p, server startup status req will be processed"
,
pMsg
);
SServerStatusRsp
statusRsp
=
{
0
};
dmGetServerStartupStatus
(
pDnode
,
&
statusRsp
);
SRpcMsg
rspMsg
=
{.
info
=
p
Req
->
info
};
SRpcMsg
rspMsg
=
{.
info
=
p
Msg
->
info
};
int32_t
rspLen
=
tSerializeSServerStatusRsp
(
NULL
,
0
,
&
statusRsp
);
if
(
rspLen
<
0
)
{
rspMsg
.
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/mgmt/node_mgmt/src/dmNodes.c
浏览文件 @
aa2faab1
...
...
@@ -37,6 +37,7 @@ static int32_t dmCreateShm(SMgmtWrapper *pWrapper) {
dError
(
"node:%s, failed to create shm size:%d since %s"
,
pWrapper
->
name
,
shmsize
,
terrstr
());
return
-
1
;
}
dInfo
(
"node:%s, shm:%d is created, size:%d"
,
pWrapper
->
name
,
pWrapper
->
proc
.
shm
.
id
,
shmsize
);
return
0
;
}
...
...
@@ -60,7 +61,7 @@ static int32_t dmNewProc(SMgmtWrapper *pWrapper, EDndNodeType ntype) {
taosIgnSignal
(
SIGCHLD
);
pWrapper
->
proc
.
pid
=
pid
;
dInfo
(
"node:%s, continue running in new p
rocess
:%d"
,
pWrapper
->
name
,
pid
);
dInfo
(
"node:%s, continue running in new p
id
:%d"
,
pWrapper
->
name
,
pid
);
return
0
;
}
...
...
@@ -77,7 +78,7 @@ int32_t dmOpenNode(SMgmtWrapper *pWrapper) {
SMgmtInputOpt
input
=
dmBuildMgmtInputOpt
(
pWrapper
);
if
(
pWrapper
->
ntype
==
DNODE
||
InChildProc
(
pWrapper
))
{
tmsgSetDefault
MsgCb
(
&
input
.
msgCb
);
tmsgSetDefault
(
&
input
.
msgCb
);
}
if
(
OnlyInSingleProc
(
pWrapper
))
{
...
...
@@ -177,11 +178,11 @@ void dmCloseNode(SMgmtWrapper *pWrapper) {
if
(
OnlyInParentProc
(
pWrapper
))
{
int32_t
pid
=
pWrapper
->
proc
.
pid
;
if
(
pid
>
0
&&
taosProcExist
(
pid
))
{
dInfo
(
"node:%s, send kill signal to the child p
rocess
:%d"
,
pWrapper
->
name
,
pid
);
dInfo
(
"node:%s, send kill signal to the child p
id
:%d"
,
pWrapper
->
name
,
pid
);
taosKillProc
(
pid
);
dInfo
(
"node:%s, wait for child p
rocess
:%d to stop"
,
pWrapper
->
name
,
pid
);
dInfo
(
"node:%s, wait for child p
id
:%d to stop"
,
pWrapper
->
name
,
pid
);
taosWaitProc
(
pid
);
dInfo
(
"node:%s, child p
rocess
:%d is stopped"
,
pWrapper
->
name
,
pid
);
dInfo
(
"node:%s, child p
id
:%d is stopped"
,
pWrapper
->
name
,
pid
);
}
}
...
...
@@ -255,7 +256,7 @@ static void dmWatchNodes(SDnode *pDnode) {
if
(
!
OnlyInParentProc
(
pWrapper
))
continue
;
if
(
proc
->
pid
<=
0
||
!
taosProcExist
(
proc
->
pid
))
{
dError
(
"node:%s, p
rocess
:%d is killed and needs to restart"
,
pWrapper
->
name
,
proc
->
pid
);
dError
(
"node:%s, p
id
:%d is killed and needs to restart"
,
pWrapper
->
name
,
proc
->
pid
);
dmCloseProcRpcHandles
(
&
pWrapper
->
proc
);
dmNewProc
(
pWrapper
,
ntype
);
}
...
...
source/dnode/mgmt/node_mgmt/src/dmProc.c
浏览文件 @
aa2faab1
...
...
@@ -162,7 +162,7 @@ static inline int32_t dmPushToProcQueue(SProc *proc, SProcQueue *queue, SRpcMsg
return
0
;
}
static
int32_t
dmPopFromProcQueue
(
SProcQueue
*
queue
,
SRpcMsg
**
ppMsg
,
EProcFuncType
*
pFuncType
)
{
static
in
line
in
t32_t
dmPopFromProcQueue
(
SProcQueue
*
queue
,
SRpcMsg
**
ppMsg
,
EProcFuncType
*
pFuncType
)
{
tsem_wait
(
&
queue
->
sem
);
taosThreadMutexLock
(
&
queue
->
mutex
);
...
...
@@ -412,7 +412,7 @@ void dmCleanupProc(struct SMgmtWrapper *pWrapper) {
SProc
*
proc
=
&
pWrapper
->
proc
;
if
(
proc
->
name
==
NULL
)
return
;
dDebug
(
"node:%s, start to clean
up proc"
,
pWrapper
->
name
);
dDebug
(
"node:%s, start to cleanup proc"
,
pWrapper
->
name
);
dmStopProc
(
proc
);
dmCleanupProcQueue
(
proc
->
cqueue
);
dmCleanupProcQueue
(
proc
->
pqueue
);
...
...
@@ -433,7 +433,7 @@ void dmCloseProcRpcHandles(SProc *proc) {
SRpcHandleInfo
*
pInfo
=
taosHashIterate
(
proc
->
hash
,
NULL
);
while
(
pInfo
!=
NULL
)
{
dError
(
"node:%s, the child process dies and send an offline rsp to handle:%p"
,
proc
->
name
,
pInfo
->
handle
);
SRpcMsg
rpcMsg
=
{.
info
=
*
pInfo
,
.
code
=
TSDB_CODE_NODE_OFFLINE
};
SRpcMsg
rpcMsg
=
{.
code
=
TSDB_CODE_NODE_OFFLINE
,
.
info
=
*
pInfo
};
rpcSendResponse
(
&
rpcMsg
);
pInfo
=
taosHashIterate
(
proc
->
hash
,
pInfo
);
}
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
aa2faab1
...
...
@@ -43,8 +43,8 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
return
-
1
;
}
dTrace
(
"msg:%p, will be processed by %s"
,
pMsg
,
pWrapper
->
name
);
pMsg
->
info
.
wrapper
=
pWrapper
;
dTrace
(
"msg:%p, will be processed by %s, handle:%p"
,
pMsg
,
pWrapper
->
name
,
pMsg
->
info
.
handle
);
return
(
*
msgFp
)(
pWrapper
->
pMgmt
,
pMsg
);
}
...
...
@@ -56,8 +56,8 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pRpc
->
msgType
)];
SMgmtWrapper
*
pWrapper
=
NULL
;
dTrace
(
"msg:%s is received, handle:%p
cont:%p len:%d code:0x%04
x app:%p refId:%"
PRId64
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
info
.
handle
,
pRpc
->
pCont
,
pRpc
->
contLen
,
pRpc
->
code
,
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
refId
);
dTrace
(
"msg:%s is received, handle:%p
len:%d code:0x%
x app:%p refId:%"
PRId64
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
info
.
handle
,
pRpc
->
contLen
,
pRpc
->
code
,
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
refId
);
pRpc
->
info
.
noResp
=
0
;
pRpc
->
info
.
persistHandle
=
0
;
pRpc
->
info
.
wrapper
=
NULL
;
...
...
@@ -344,66 +344,6 @@ void dmCleanupClient(SDnode *pDnode) {
}
}
static
inline
int32_t
dmGetHideUserAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
int32_t
code
=
0
;
char
pass
[
TSDB_PASSWORD_LEN
+
1
]
=
{
0
};
if
(
strcmp
(
user
,
INTERNAL_USER
)
==
0
)
{
taosEncryptPass_c
((
uint8_t
*
)(
INTERNAL_SECRET
),
strlen
(
INTERNAL_SECRET
),
pass
);
}
else
if
(
strcmp
(
user
,
TSDB_NETTEST_USER
)
==
0
)
{
taosEncryptPass_c
((
uint8_t
*
)(
TSDB_NETTEST_USER
),
strlen
(
TSDB_NETTEST_USER
),
pass
);
}
else
{
code
=
-
1
;
}
if
(
code
==
0
)
{
memcpy
(
secret
,
pass
,
TSDB_PASSWORD_LEN
);
*
spi
=
1
;
*
encrypt
=
0
;
*
ckey
=
0
;
}
return
code
;
}
static
inline
int32_t
dmRetrieveUserAuthInfo
(
SDnode
*
pDnode
,
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
if
(
dmGetHideUserAuth
(
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
dTrace
(
"user:%s, get auth from mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
return
0
;
}
SAuthReq
authReq
=
{
0
};
tstrncpy
(
authReq
.
user
,
user
,
TSDB_USER_LEN
);
int32_t
contLen
=
tSerializeSAuthReq
(
NULL
,
0
,
&
authReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeSAuthReq
(
pReq
,
contLen
,
&
authReq
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pReq
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_AUTH
,
.
info
.
ahandle
=
(
void
*
)
9528
};
SRpcMsg
rpcRsp
=
{
0
};
SEpSet
epSet
=
{
0
};
dTrace
(
"user:%s, send user auth req to other mnodes, spi:%d encrypt:%d"
,
user
,
authReq
.
spi
,
authReq
.
encrypt
);
dmGetMnodeEpSet
(
&
pDnode
->
data
,
&
epSet
);
dmSendRecv
(
&
epSet
,
&
rpcMsg
,
&
rpcRsp
);
if
(
rpcRsp
.
code
!=
0
)
{
terrno
=
rpcRsp
.
code
;
dError
(
"user:%s, failed to get user auth from other mnodes since %s"
,
user
,
terrstr
());
}
else
{
SAuthRsp
authRsp
=
{
0
};
tDeserializeSAuthReq
(
rpcRsp
.
pCont
,
rpcRsp
.
contLen
,
&
authRsp
);
memcpy
(
secret
,
authRsp
.
secret
,
TSDB_PASSWORD_LEN
);
memcpy
(
ckey
,
authRsp
.
ckey
,
TSDB_PASSWORD_LEN
);
*
spi
=
authRsp
.
spi
;
*
encrypt
=
authRsp
.
encrypt
;
dTrace
(
"user:%s, success to get user auth from other mnodes, spi:%d encrypt:%d"
,
user
,
authRsp
.
spi
,
authRsp
.
encrypt
);
}
rpcFreeCont
(
rpcRsp
.
pCont
);
return
rpcRsp
.
code
;
}
int32_t
dmInitServer
(
SDnode
*
pDnode
)
{
SDnodeTrans
*
pTrans
=
&
pDnode
->
trans
;
...
...
@@ -416,7 +356,6 @@ int32_t dmInitServer(SDnode *pDnode) {
rpcInit
.
sessions
=
tsMaxShellConns
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1000
;
rpcInit
.
afp
=
(
RpcAfp
)
dmRetrieveUserAuthInfo
;
rpcInit
.
parent
=
pDnode
;
pTrans
->
serverRpc
=
rpcOpen
(
&
rpcInit
);
...
...
source/dnode/mnode/impl/inc/mndVgroup.h
浏览文件 @
aa2faab1
...
...
@@ -37,7 +37,7 @@ int32_t mndRemoveVnodeFromVgroup(SMnode *pMnode, SVgObj *pVgroup, SArray *pArray
void
*
mndBuildCreateVnodeReq
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
void
*
mndBuildDropVnodeReq
(
SMnode
*
pMnode
,
SDnodeObj
*
pDnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
void
*
mndBuildAlterVnodeReq
(
SMnode
*
pMnode
,
SD
nodeObj
*
pDnode
,
SD
bObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
void
*
mndBuildAlterVnodeReq
(
SMnode
*
pMnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
);
#ifdef __cplusplus
}
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
aa2faab1
...
...
@@ -261,8 +261,7 @@ void mndReleaseDb(SMnode *pMnode, SDbObj *pDb) {
sdbRelease
(
pSdb
,
pDb
);
}
static
int32_t
mndAddCreateVnodeAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
SVnodeGid
*
pVgid
,
bool
isRedo
)
{
static
int32_t
mndAddCreateVnodeAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
SVnodeGid
*
pVgid
)
{
STransAction
action
=
{
0
};
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pVgid
->
dnodeId
);
...
...
@@ -279,49 +278,30 @@ static int32_t mndAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *p
action
.
msgType
=
TDMT_DND_CREATE_VNODE
;
action
.
acceptableCode
=
TSDB_CODE_NODE_ALREADY_DEPLOYED
;
if
(
isRedo
)
{
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFree
(
pReq
);
return
-
1
;
}
}
else
{
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFree
(
pReq
);
return
-
1
;
}
}
return
0
;
}
static
int32_t
mndAddAlterVnodeAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
SVnodeGid
*
pVgid
,
bool
isRedo
)
{
static
int32_t
mndAddAlterVnodeAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
)
{
STransAction
action
=
{
0
};
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pVgid
->
dnodeId
);
if
(
pDnode
==
NULL
)
return
-
1
;
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
action
.
epSet
=
mndGetVgroupEpset
(
pMnode
,
pVgroup
);
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildAlterVnodeReq
(
pMnode
,
pD
node
,
pD
b
,
pVgroup
,
&
contLen
);
void
*
pReq
=
mndBuildAlterVnodeReq
(
pMnode
,
pDb
,
pVgroup
,
&
contLen
);
if
(
pReq
==
NULL
)
return
-
1
;
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_VND_ALTER_VNODE
;
if
(
isRedo
)
{
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFree
(
pReq
);
return
-
1
;
}
}
else
{
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFree
(
pReq
);
return
-
1
;
}
}
return
0
;
}
...
...
@@ -487,7 +467,7 @@ static int32_t mndSetCreateDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
for
(
int32_t
vn
=
0
;
vn
<
pVgroup
->
replica
;
++
vn
)
{
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
vn
;
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
pVgroup
,
pVgid
,
true
)
!=
0
)
{
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
pVgroup
,
pVgid
)
!=
0
)
{
return
-
1
;
}
}
...
...
@@ -726,12 +706,9 @@ static int32_t mndSetAlterDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *p
static
int32_t
mndBuildAlterVgroupAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
SArray
*
pArray
)
{
if
(
pVgroup
->
replica
<=
0
||
pVgroup
->
replica
==
pDb
->
cfg
.
replications
)
{
for
(
int32_t
vn
=
0
;
vn
<
pVgroup
->
replica
;
++
vn
)
{
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
vn
;
if
(
mndAddAlterVnodeAction
(
pMnode
,
pTrans
,
pDb
,
pVgroup
,
pVgid
,
true
)
!=
0
)
{
if
(
mndAddAlterVnodeAction
(
pMnode
,
pTrans
,
pDb
,
pVgroup
)
!=
0
)
{
return
-
1
;
}
}
}
else
{
SVgObj
newVgroup
=
{
0
};
memcpy
(
&
newVgroup
,
pVgroup
,
sizeof
(
SVgObj
));
...
...
@@ -744,9 +721,9 @@ static int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj
return
-
1
;
}
newVgroup
.
replica
=
pDb
->
cfg
.
replications
;
if
(
mndAddAlterVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
newVgroup
.
vnodeGid
[
0
],
true
)
!=
0
)
return
-
1
;
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
newVgroup
.
vnodeGid
[
1
]
,
true
)
!=
0
)
return
-
1
;
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
newVgroup
.
vnodeGid
[
2
]
,
true
)
!=
0
)
return
-
1
;
if
(
mndAddAlterVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
)
!=
0
)
return
-
1
;
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
newVgroup
.
vnodeGid
[
1
])
!=
0
)
return
-
1
;
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
newVgroup
.
vnodeGid
[
2
])
!=
0
)
return
-
1
;
}
else
{
mInfo
(
"db:%s, vgId:%d, will remove 2 vnodes"
,
pVgroup
->
dbName
,
pVgroup
->
vgId
);
...
...
@@ -757,7 +734,7 @@ static int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj
return
-
1
;
}
newVgroup
.
replica
=
pDb
->
cfg
.
replications
;
if
(
mndAddAlterVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
newVgroup
.
vnodeGid
[
0
],
true
)
!=
0
)
return
-
1
;
if
(
mndAddAlterVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
)
!=
0
)
return
-
1
;
if
(
mndAddDropVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
del1
,
true
)
!=
0
)
return
-
1
;
if
(
mndAddDropVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVgroup
,
&
del2
,
true
)
!=
0
)
return
-
1
;
}
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
aa2faab1
...
...
@@ -197,8 +197,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
goto
CONN_OVER
;
}
if
(
0
!=
strncmp
(
connReq
.
passwd
,
pUser
->
pass
,
TSDB_PASSWORD_LEN
-
1
))
{
mError
(
"user:%s, failed to auth while acquire user, input:%s saved:%s"
,
pReq
->
conn
.
user
,
connReq
.
passwd
,
pUser
->
pass
);
mError
(
"user:%s, failed to auth while acquire user, input:%s"
,
pReq
->
conn
.
user
,
connReq
.
passwd
);
code
=
TSDB_CODE_RPC_AUTH_FAILURE
;
goto
CONN_OVER
;
}
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
aa2faab1
...
...
@@ -206,7 +206,7 @@ static SMqRebInfo *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) {
static
int32_t
mndDoRebalance
(
SMnode
*
pMnode
,
const
SMqRebInputObj
*
pInput
,
SMqRebOutputObj
*
pOutput
)
{
int32_t
totalVgNum
=
pOutput
->
pSub
->
vgNum
;
mInfo
(
"mq rebalance subscription: %s, vgNum: %d"
,
pOutput
->
pSub
->
key
,
pOutput
->
pSub
->
vgNum
);
mInfo
(
"mq rebalance
:
subscription: %s, vgNum: %d"
,
pOutput
->
pSub
->
key
,
pOutput
->
pSub
->
vgNum
);
// 1. build temporary hash(vgId -> SMqRebOutputVg) to store modified vg
SHashObj
*
pHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_NO_LOCK
);
...
...
@@ -231,6 +231,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.
pVgEp
=
pVgEp
,
};
taosHashPut
(
pHash
,
&
pVgEp
->
vgId
,
sizeof
(
int32_t
),
&
outputVg
,
sizeof
(
SMqRebOutputVg
));
mInfo
(
"mq rebalance: remove vg %d from consumer %ld"
,
pVgEp
->
vgId
,
consumerId
);
}
taosHashRemove
(
pOutput
->
pSub
->
consumerHash
,
&
consumerId
,
sizeof
(
int64_t
));
// put into removed
...
...
@@ -250,6 +251,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.
pVgEp
=
pVgEp
,
};
taosHashPut
(
pHash
,
&
pVgEp
->
vgId
,
sizeof
(
int32_t
),
&
rebOutput
,
sizeof
(
SMqRebOutputVg
));
mInfo
(
"mq rebalance: remove vg %d from unassigned"
,
pVgEp
->
vgId
);
}
}
...
...
@@ -263,6 +265,8 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
minVgCnt
=
totalVgNum
/
afterRebConsumerNum
;
imbConsumerNum
=
totalVgNum
%
afterRebConsumerNum
;
}
mInfo
(
"mq rebalance: %d consumer after rebalance, at least %d vg each, %d consumer has more vg"
,
afterRebConsumerNum
,
minVgCnt
,
imbConsumerNum
);
// 4. first scan: remove consumer more than wanted, put to remove hash
int32_t
imbCnt
=
0
;
...
...
@@ -290,6 +294,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.
pVgEp
=
pVgEp
,
};
taosHashPut
(
pHash
,
&
pVgEp
->
vgId
,
sizeof
(
int32_t
),
&
outputVg
,
sizeof
(
SMqRebOutputVg
));
mInfo
(
"mq rebalance: remove vg %d from consumer %ld (first scan)"
,
pVgEp
->
vgId
,
pConsumerEp
->
consumerId
);
}
imbCnt
++
;
}
...
...
@@ -303,6 +308,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
.
pVgEp
=
pVgEp
,
};
taosHashPut
(
pHash
,
&
pVgEp
->
vgId
,
sizeof
(
int32_t
),
&
outputVg
,
sizeof
(
SMqRebOutputVg
));
mInfo
(
"mq rebalance: remove vg %d from consumer %ld (first scan)"
,
pVgEp
->
vgId
,
pConsumerEp
->
consumerId
);
}
}
}
...
...
@@ -319,6 +325,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
newConsumerEp
.
vgs
=
taosArrayInit
(
0
,
sizeof
(
void
*
));
taosHashPut
(
pOutput
->
pSub
->
consumerHash
,
&
consumerId
,
sizeof
(
int64_t
),
&
newConsumerEp
,
sizeof
(
SMqConsumerEp
));
taosArrayPush
(
pOutput
->
newConsumers
,
&
consumerId
);
mInfo
(
"mq rebalance: add new consumer %ld"
,
consumerId
);
}
}
...
...
@@ -343,6 +350,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
taosArrayPush
(
pConsumerEp
->
vgs
,
&
pRebVg
->
pVgEp
);
pRebVg
->
newConsumerId
=
pConsumerEp
->
consumerId
;
taosArrayPush
(
pOutput
->
rebVgs
,
pRebVg
);
mInfo
(
"mq rebalance: add vg %d to consumer %ld (second scan)"
,
pRebVg
->
pVgEp
->
vgId
,
pConsumerEp
->
consumerId
);
}
}
...
...
@@ -360,6 +368,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
taosArrayPush
(
pConsumerEp
->
vgs
,
&
pRebVg
->
pVgEp
);
pRebVg
->
newConsumerId
=
pConsumerEp
->
consumerId
;
taosArrayPush
(
pOutput
->
rebVgs
,
pRebVg
);
mInfo
(
"mq rebalance: add vg %d to consumer %ld (second scan)"
,
pRebVg
->
pVgEp
->
vgId
,
pConsumerEp
->
consumerId
);
}
}
else
{
// if all consumer is removed, put all vg into unassigned
...
...
@@ -372,6 +381,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
ASSERT
(
pRebOutput
->
newConsumerId
==
-
1
);
taosArrayPush
(
pOutput
->
pSub
->
unassignedVgs
,
&
pRebOutput
->
pVgEp
);
taosArrayPush
(
pOutput
->
rebVgs
,
pRebOutput
);
mInfo
(
"mq rebalance: unassign vg %d (second scan)"
,
pRebOutput
->
pVgEp
->
vgId
);
}
}
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
aa2faab1
...
...
@@ -842,13 +842,12 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
}
taosMemoryFree
(
pTrans
->
rpcRsp
);
mDebug
(
"trans:%d, send rsp, code:0x%04x stage:%d app:%p"
,
pTrans
->
id
,
code
&
0xFFFF
,
pTrans
->
stage
,
pTrans
->
rpcInfo
.
ahandle
);
mDebug
(
"trans:%d, send rsp, code:0x%x stage:%d app:%p"
,
pTrans
->
id
,
code
,
pTrans
->
stage
,
pTrans
->
rpcInfo
.
ahandle
);
SRpcMsg
rspMsg
=
{
.
info
=
pTrans
->
rpcInfo
,
.
code
=
code
,
.
pCont
=
rpcCont
,
.
contLen
=
pTrans
->
rpcRspLen
,
.
info
=
pTrans
->
rpcInfo
,
};
tmsgSendRsp
(
&
rspMsg
);
pTrans
->
rpcInfo
.
handle
=
NULL
;
...
...
@@ -899,7 +898,7 @@ void mndTransProcessRsp(SRpcMsg *pRsp) {
}
}
mDebug
(
"trans:%d, action:%d response is received, code:0x%
04
x, accept:0x%04x"
,
transId
,
action
,
pRsp
->
code
,
mDebug
(
"trans:%d, action:%d response is received, code:0x%x, accept:0x%04x"
,
transId
,
action
,
pRsp
->
code
,
pAction
->
acceptableCode
);
mndTransExecute
(
pMnode
,
pTrans
);
...
...
@@ -986,7 +985,8 @@ static int32_t mndTransSendActionMsg(SMnode *pMnode, STrans *pTrans, SArray *pAr
memcpy
(
rpcMsg
.
pCont
,
pAction
->
pCont
,
pAction
->
contLen
);
if
(
tmsgSendReq
(
&
pAction
->
epSet
,
&
rpcMsg
)
==
0
)
{
mDebug
(
"trans:%d, action:%d is sent"
,
pTrans
->
id
,
action
);
mDebug
(
"trans:%d, action:%d is sent to %s:%u"
,
pTrans
->
id
,
action
,
pAction
->
epSet
.
eps
[
pAction
->
epSet
.
inUse
].
fqdn
,
pAction
->
epSet
.
eps
[
pAction
->
epSet
.
inUse
].
port
);
pAction
->
msgSent
=
1
;
pAction
->
msgReceived
=
0
;
pAction
->
errCode
=
0
;
...
...
@@ -1031,7 +1031,7 @@ static int32_t mndTransExecuteActions(SMnode *pMnode, STrans *pTrans, SArray *pA
mDebug
(
"trans:%d, all %d actions execute successfully"
,
pTrans
->
id
,
numOfActions
);
return
0
;
}
else
{
mError
(
"trans:%d, all %d actions executed, code:0x%
04
x"
,
pTrans
->
id
,
numOfActions
,
errCode
&
0XFFFF
);
mError
(
"trans:%d, all %d actions executed, code:0x%x"
,
pTrans
->
id
,
numOfActions
,
errCode
&
0XFFFF
);
mndTransResetActions
(
pMnode
,
pTrans
,
pArray
);
terrno
=
errCode
;
return
errCode
;
...
...
@@ -1222,7 +1222,7 @@ static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans) {
mError
(
"trans:%d, failed to write sdb since %s"
,
pTrans
->
id
,
terrstr
());
}
mDebug
(
"trans:%d, finished, code:0x%
04
x, failedTimes:%d"
,
pTrans
->
id
,
pTrans
->
code
,
pTrans
->
failedTimes
);
mDebug
(
"trans:%d, finished, code:0x%x, failedTimes:%d"
,
pTrans
->
id
,
pTrans
->
code
,
pTrans
->
failedTimes
);
return
continueExec
;
}
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
aa2faab1
...
...
@@ -256,7 +256,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
return
pReq
;
}
void
*
mndBuildAlterVnodeReq
(
SMnode
*
pMnode
,
SD
nodeObj
*
pDnode
,
SD
bObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
)
{
void
*
mndBuildAlterVnodeReq
(
SMnode
*
pMnode
,
SDbObj
*
pDb
,
SVgObj
*
pVgroup
,
int32_t
*
pContLen
)
{
SAlterVnodeReq
alterReq
=
{
0
};
alterReq
.
vgVersion
=
pVgroup
->
version
;
alterReq
.
buffer
=
pDb
->
cfg
.
buffer
;
...
...
@@ -285,16 +285,14 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgO
pReplica
->
port
=
pVgidDnode
->
port
;
memcpy
(
pReplica
->
fqdn
,
pVgidDnode
->
fqdn
,
TSDB_FQDN_LEN
);
mndReleaseDnode
(
pMnode
,
pVgidDnode
);
if
(
pDnode
->
id
==
pVgid
->
dnodeId
)
{
alterReq
.
selfIndex
=
v
;
}
}
#if 0
if (alterReq.selfIndex == -1) {
terrno = TSDB_CODE_MND_APP_ERROR;
return NULL;
}
#endif
int32_t
contLen
=
tSerializeSAlterVnodeReq
(
NULL
,
0
,
&
alterReq
);
if
(
contLen
<
0
)
{
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
aa2faab1
...
...
@@ -343,20 +343,21 @@ void mndStop(SMnode *pMnode) { return mndCleanupTimer(pMnode); }
int32_t
mndProcessMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
void
*
ahandle
=
pMsg
->
info
.
ahandle
;
mTrace
(
"msg:%p, will be processed, type:%s app:%p"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
),
ahandle
);
if
(
IsReq
(
pMsg
)
&&
!
mndIsMaster
(
pMnode
))
{
if
(
IsReq
(
pMsg
))
{
if
(
!
mndIsMaster
(
pMnode
))
{
terrno
=
TSDB_CODE_APP_NOT_READY
;
mDebug
(
"msg:%p, failed to process since %s, app:%p"
,
pMsg
,
terrstr
(),
ahandle
);
return
-
1
;
}
if
(
IsReq
(
pMsg
)
&&
(
pMsg
->
contLen
==
0
||
pMsg
->
pCont
==
NULL
)
)
{
if
(
pMsg
->
contLen
==
0
||
pMsg
->
pCont
==
NULL
)
{
terrno
=
TSDB_CODE_INVALID_MSG_LEN
;
mError
(
"msg:%p, failed to process since %s, app:%p"
,
pMsg
,
terrstr
(),
ahandle
);
return
-
1
;
}
}
MndMsgFp
fp
=
pMnode
->
msgFp
[
TMSG_INDEX
(
pMsg
->
msgType
)];
if
(
fp
==
NULL
)
{
...
...
@@ -488,7 +489,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
tstrncpy
(
desc
.
status
,
"ready"
,
sizeof
(
desc
.
status
));
pClusterInfo
->
vgroups_alive
++
;
}
if
(
pVgid
->
role
==
TAOS_SYNC_STATE_LEADER
||
pVgid
->
role
==
TAOS_SYNC_STATE_CANDIDATE
)
{
if
(
pVgid
->
role
!=
TAOS_SYNC_STATE_ERROR
)
{
pClusterInfo
->
vnodes_alive
++
;
}
pClusterInfo
->
vnodes_total
++
;
...
...
source/dnode/mnode/impl/test/trans/trans2.cpp
浏览文件 @
aa2faab1
...
...
@@ -56,7 +56,7 @@ class MndTestTrans2 : public ::testing::Test {
msgCb
.
sendReqFp
=
sendReq
;
msgCb
.
sendRspFp
=
sendRsp
;
msgCb
.
mgmt
=
(
SMgmtWrapper
*
)(
&
msgCb
);
// hack
tmsgSetDefault
MsgCb
(
&
msgCb
);
tmsgSetDefault
(
&
msgCb
);
SMnodeOpt
opt
=
{
0
};
opt
.
deploy
=
1
;
...
...
source/dnode/vnode/src/inc/tq.h
浏览文件 @
aa2faab1
...
...
@@ -179,6 +179,7 @@ struct STQ {
SHashObj
*
pStreamTasks
;
SVnode
*
pVnode
;
SWal
*
pWal
;
// TDB* pTdb;
};
typedef
struct
{
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
aa2faab1
...
...
@@ -443,6 +443,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
entry
.
version
=
version
;
int
tlen
;
SSchema
*
pNewSchema
=
NULL
;
switch
(
pAlterTbReq
->
action
)
{
case
TSDB_ALTER_TABLE_ADD_COLUMN
:
if
(
pColumn
)
{
...
...
@@ -451,8 +452,9 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
}
pSchema
->
sver
++
;
pSchema
->
nCols
++
;
pSchema
->
pSchema
=
taosMemoryRealloc
(
entry
.
ntbEntry
.
schema
.
pSchema
,
sizeof
(
SSchema
)
*
entry
.
ntbEntry
.
schema
.
nCols
);
pNewSchema
=
taosMemoryMalloc
(
sizeof
(
SSchema
)
*
pSchema
->
nCols
);
memcpy
(
pNewSchema
,
pSchema
->
pSchema
,
sizeof
(
SSchema
)
*
(
pSchema
->
nCols
-
1
));
pSchema
->
pSchema
=
pNewSchema
;
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schema
.
nCols
-
1
].
bytes
=
pAlterTbReq
->
bytes
;
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schema
.
nCols
-
1
].
type
=
pAlterTbReq
->
type
;
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schema
.
nCols
-
1
].
flags
=
pAlterTbReq
->
flags
;
...
...
@@ -511,6 +513,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
metaULock
(
pMeta
);
if
(
pNewSchema
)
taosMemoryFree
(
pNewSchema
);
tDecoderClear
(
&
dc
);
tdbTbcClose
(
pTbDbc
);
tdbTbcClose
(
pUidIdxc
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
aa2faab1
...
...
@@ -32,6 +32,9 @@ STQ* tqOpen(const char* path, SVnode* pVnode, SWal* pWal) {
pTq
->
path
=
strdup
(
path
);
pTq
->
pVnode
=
pVnode
;
pTq
->
pWal
=
pWal
;
/*if (tdbOpen(path, 4096, 1, &pTq->pTdb) < 0) {*/
/*ASSERT(0);*/
/*}*/
#if 0
pTq->tqMeta = tqStoreOpen(pTq, path, (FTqSerialize)tqSerializeConsumer, (FTqDeserialize)tqDeserializeConsumer,
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
aa2faab1
...
...
@@ -378,6 +378,13 @@ typedef enum EStreamScanMode {
STREAM_SCAN_FROM_DATAREADER
,
}
EStreamScanMode
;
typedef
struct
SCatchSupporter
{
SHashObj
*
pWindowHashTable
;
// quick locate the window object for each window
SDiskbasedBuf
*
pDataBuf
;
// buffer based on blocked-wised disk file
int32_t
keySize
;
int64_t
*
pKeyBuf
;
}
SCatchSupporter
;
typedef
struct
SStreamBlockScanInfo
{
SArray
*
pBlockLists
;
// multiple SSDatablock.
SSDataBlock
*
pRes
;
// result SSDataBlock
...
...
@@ -400,6 +407,8 @@ typedef struct SStreamBlockScanInfo {
EStreamScanMode
scanMode
;
SOperatorInfo
*
pOperatorDumy
;
SInterval
interval
;
// if the upstream is an interval operator, the interval info is also kept here.
SCatchSupporter
childAggSup
;
SArray
*
childIds
;
}
SStreamBlockScanInfo
;
typedef
struct
SSysTableScanInfo
{
...
...
@@ -460,6 +469,16 @@ typedef struct SIntervalAggOperatorInfo {
bool
invertible
;
}
SIntervalAggOperatorInfo
;
typedef
struct
SStreamFinalIntervalOperatorInfo
{
SOptrBasicInfo
binfo
;
// basic info
SGroupResInfo
groupResInfo
;
// multiple results build supporter
SInterval
interval
;
// interval info
int32_t
primaryTsIndex
;
// primary time stamp slot id from result of downstream operator.
SAggSupporter
aggSup
;
// aggregate supporter
int32_t
order
;
// current SSDataBlock scan order
STimeWindowAggSupp
twAggSup
;
}
SStreamFinalIntervalOperatorInfo
;
typedef
struct
SAggOperatorInfo
{
SOptrBasicInfo
binfo
;
SAggSupporter
aggSup
;
...
...
@@ -696,6 +715,9 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
SOperatorInfo
*
createIntervalOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
SInterval
*
pInterval
,
int32_t
primaryTsSlotId
,
STimeWindowAggSupp
*
pTwAggSupp
,
const
STableGroupInfo
*
pTableGroupInfo
,
SExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createStreamFinalIntervalOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
SInterval
*
pInterval
,
int32_t
primaryTsSlotId
,
STimeWindowAggSupp
*
pTwAggSupp
,
const
STableGroupInfo
*
pTableGroupInfo
,
SExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createStreamIntervalOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
SInterval
*
pInterval
,
int32_t
primaryTsSlotId
,
...
...
@@ -771,9 +793,8 @@ int32_t getNumOfRowsInTimeWindow(SDataBlockInfo* pDataBlockInfo, TSKEY* pPrimary
TSKEY
ekey
,
__block_search_fn_t
searchFn
,
STableQueryInfo
*
item
,
int32_t
order
);
int32_t
binarySearchForKey
(
char
*
pValue
,
int
num
,
TSKEY
key
,
int
order
);
void
doClearWindow
(
SIntervalAggOperatorInfo
*
pInfo
,
char
*
pData
,
int16_t
bytes
,
uint64_t
groupId
,
int32_t
numOfOutput
);
int32_t
initCatchSupporter
(
SCatchSupporter
*
pCatchSup
,
size_t
rowSize
,
size_t
keyBufSize
,
const
char
*
pKey
,
const
char
*
pDir
);
#ifdef __cplusplus
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
aa2faab1
...
...
@@ -106,7 +106,7 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, void* streamReadHandle) {
pMsg->contentLen = pMsg->contentLen;
#endif
qDebugL
(
"stream task string %s"
,
(
const
char
*
)
msg
);
/*qDebugL("stream task string %s", (const char*)msg);*/
struct
SSubplan
*
plan
=
NULL
;
int32_t
code
=
qStringToSubplan
(
msg
,
&
plan
);
...
...
source/libs/executor/src/executorMain.c
浏览文件 @
aa2faab1
...
...
@@ -133,6 +133,7 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t *useconds) {
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
publishQueryAbortEvent
(
pTaskInfo
,
ret
);
pTaskInfo
->
code
=
ret
;
cleanUpUdfs
();
qDebug
(
"%s task abort due to error/cancel occurs, code:%s"
,
GET_TASKID
(
pTaskInfo
),
tstrerror
(
pTaskInfo
->
code
));
return
pTaskInfo
->
code
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
aa2faab1
...
...
@@ -342,28 +342,6 @@ SResultRow* getNewResultRow_rv(SDiskbasedBuf* pResultBuf, int64_t tableGroupId,
return
pResultRow
;
}
void
doClearWindow
(
SIntervalAggOperatorInfo
*
pInfo
,
char
*
pData
,
int16_t
bytes
,
uint64_t
groupId
,
int32_t
numOfOutput
)
{
SAggSupporter
*
pSup
=
&
pInfo
->
aggSup
;
SET_RES_WINDOW_KEY
(
pSup
->
keyBuf
,
pData
,
bytes
,
groupId
);
SResultRowPosition
*
p1
=
(
SResultRowPosition
*
)
taosHashGet
(
pSup
->
pResultRowHashTable
,
pSup
->
keyBuf
,
GET_RES_WINDOW_KEY_LEN
(
bytes
));
SResultRow
*
pResult
=
getResultRowByPos
(
pSup
->
pResultBuf
,
p1
);
SqlFunctionCtx
*
pCtx
=
pInfo
->
binfo
.
pCtx
;
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
pCtx
[
i
].
resultInfo
=
getResultCell
(
pResult
,
i
,
pInfo
->
binfo
.
rowCellInfoOffset
);
struct
SResultRowEntryInfo
*
pResInfo
=
pCtx
[
i
].
resultInfo
;
if
(
fmIsWindowPseudoColumnFunc
(
pCtx
[
i
].
functionId
))
{
continue
;
}
pResInfo
->
initialized
=
false
;
if
(
pCtx
[
i
].
functionId
!=
-
1
)
{
pCtx
[
i
].
fpSet
.
init
(
&
pCtx
[
i
],
pResInfo
);
}
}
}
/**
* the struct of key in hash table
* +----------+---------------+
...
...
@@ -5321,3 +5299,16 @@ int32_t getOperatorExplainExecInfo(SOperatorInfo* operatorInfo, SExplainExecInfo
return
TSDB_CODE_SUCCESS
;
}
int32_t
initCatchSupporter
(
SCatchSupporter
*
pCatchSup
,
size_t
rowSize
,
size_t
keyBufSize
,
const
char
*
pKey
,
const
char
*
pDir
)
{
pCatchSup
->
keySize
=
sizeof
(
int64_t
)
+
sizeof
(
int64_t
)
+
sizeof
(
TSKEY
);
pCatchSup
->
pKeyBuf
=
taosMemoryCalloc
(
1
,
pCatchSup
->
keySize
);
int32_t
pageSize
=
rowSize
*
32
;
int32_t
bufSize
=
pageSize
*
4096
;
createDiskbasedBuf
(
&
pCatchSup
->
pDataBuf
,
pageSize
,
bufSize
,
pKey
,
pDir
);
_hash_fn_t
hashFn
=
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
);
pCatchSup
->
pWindowHashTable
=
taosHashInit
(
10000
,
hashFn
,
true
,
HASH_NO_LOCK
);;
return
TSDB_CODE_SUCCESS
;
}
source/libs/executor/src/scanoperator.c
浏览文件 @
aa2faab1
...
...
@@ -36,6 +36,11 @@
#define SET_REVERSE_SCAN_FLAG(_info) ((_info)->scanFlag = REVERSE_SCAN)
#define SWITCH_ORDER(n) (((n) = ((n) == TSDB_ORDER_ASC) ? TSDB_ORDER_DESC : TSDB_ORDER_ASC))
typedef
struct
SWindowPosition
{
int32_t
pageId
;
int32_t
rowId
;
}
SWindowPosition
;
static
int32_t
buildSysDbTableInfo
(
const
SSysTableScanInfo
*
pInfo
,
int32_t
capacity
);
static
int32_t
buildDbTableInfoBlock
(
const
SSDataBlock
*
p
,
const
SSysTableMeta
*
pSysDbTableMeta
,
size_t
size
,
const
char
*
dbName
);
...
...
@@ -675,6 +680,96 @@ static SSDataBlock* getUpdateDataBlock(SStreamBlockScanInfo* pInfo, bool inverti
return
NULL
;
}
void
static
setSupKeyBuf
(
SCatchSupporter
*
pSup
,
int64_t
groupId
,
int64_t
childId
,
TSKEY
ts
)
{
int64_t
*
pKey
=
(
int64_t
*
)
pSup
->
pKeyBuf
;
pKey
[
0
]
=
groupId
;
pKey
[
1
]
=
childId
;
pKey
[
2
]
=
ts
;
}
static
int32_t
catchWidonwInfo
(
SSDataBlock
*
pDataBlock
,
SCatchSupporter
*
pSup
,
int32_t
pageId
,
int32_t
tsIndex
,
int64_t
childId
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
tsIndex
);
TSKEY
*
tsCols
=
(
int64_t
*
)
pColDataInfo
->
pData
;
for
(
int32_t
i
=
0
;
i
<
pDataBlock
->
info
.
rows
;
i
++
)
{
setSupKeyBuf
(
pSup
,
pDataBlock
->
info
.
groupId
,
childId
,
tsCols
[
i
]);
SWindowPosition
*
p1
=
(
SWindowPosition
*
)
taosHashGet
(
pSup
->
pWindowHashTable
,
pSup
->
pKeyBuf
,
pSup
->
keySize
);
if
(
p1
==
NULL
)
{
SWindowPosition
pos
=
{.
pageId
=
pageId
,
.
rowId
=
i
};
int32_t
code
=
taosHashPut
(
pSup
->
pWindowHashTable
,
pSup
->
pKeyBuf
,
pSup
->
keySize
,
&
pos
,
sizeof
(
SWindowPosition
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
else
{
p1
->
pageId
=
pageId
;
p1
->
rowId
=
i
;
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
catchDatablock
(
SSDataBlock
*
pDataBlock
,
SCatchSupporter
*
pSup
,
int32_t
tsIndex
,
int64_t
childId
)
{
int32_t
start
=
0
;
int32_t
stop
=
0
;
int32_t
pageSize
=
getBufPageSize
(
pSup
->
pDataBuf
);
while
(
start
<
pDataBlock
->
info
.
rows
)
{
blockDataSplitRows
(
pDataBlock
,
pDataBlock
->
info
.
hasVarCol
,
start
,
&
stop
,
pageSize
);
SSDataBlock
*
pDB
=
blockDataExtractBlock
(
pDataBlock
,
start
,
stop
-
start
+
1
);
if
(
pDB
==
NULL
)
{
return
terrno
;
}
int32_t
pageId
=
-
1
;
void
*
pPage
=
getNewBufPage
(
pSup
->
pDataBuf
,
pDataBlock
->
info
.
groupId
,
&
pageId
);
if
(
pPage
==
NULL
)
{
blockDataDestroy
(
pDB
);
return
terrno
;
}
int32_t
size
=
blockDataGetSize
(
pDB
)
+
sizeof
(
int32_t
)
+
pDB
->
info
.
numOfCols
*
sizeof
(
int32_t
);
assert
(
size
<=
pageSize
);
blockDataToBuf
(
pPage
,
pDB
);
setBufPageDirty
(
pPage
,
true
);
releaseBufPage
(
pSup
->
pDataBuf
,
pPage
);
blockDataDestroy
(
pDB
);
start
=
stop
+
1
;
int32_t
code
=
catchWidonwInfo
(
pDB
,
pSup
,
pageId
,
tsIndex
,
childId
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
return
TSDB_CODE_SUCCESS
;
}
static
SSDataBlock
*
getDataFromCatch
(
SStreamBlockScanInfo
*
pInfo
)
{
SSDataBlock
*
pBlock
=
pInfo
->
pUpdateRes
;
if
(
pInfo
->
updateResIndex
<
pBlock
->
info
.
rows
)
{
blockDataCleanup
(
pInfo
->
pRes
);
SCatchSupporter
*
pCSup
=
&
pInfo
->
childAggSup
;
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
0
);
TSKEY
*
tsCols
=
(
TSKEY
*
)
pColDataInfo
->
pData
;
int32_t
size
=
taosArrayGetSize
(
pInfo
->
childIds
);
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
int64_t
id
=
*
(
int64_t
*
)
taosArrayGet
(
pInfo
->
childIds
,
i
);
setSupKeyBuf
(
pCSup
,
pBlock
->
info
.
groupId
,
id
,
tsCols
[
pInfo
->
updateResIndex
]);
SWindowPosition
*
pos
=
(
SWindowPosition
*
)
taosHashGet
(
pCSup
->
pWindowHashTable
,
pCSup
->
pKeyBuf
,
pCSup
->
keySize
);
void
*
buf
=
getBufPage
(
pCSup
->
pDataBuf
,
pos
->
pageId
);
SSDataBlock
*
pDB
=
createOneDataBlock
(
pInfo
->
pRes
,
false
);
blockDataFromBuf
(
pDB
,
buf
);
SSDataBlock
*
pSub
=
blockDataExtractBlock
(
pDB
,
pos
->
rowId
,
1
);
blockDataMerge
(
pInfo
->
pRes
,
pSub
,
NULL
);
blockDataDestroy
(
pDB
);
blockDataDestroy
(
pSub
);
}
pInfo
->
updateResIndex
++
;
return
pInfo
->
pRes
;
}
return
NULL
;
}
static
SSDataBlock
*
doStreamBlockScan
(
SOperatorInfo
*
pOperator
)
{
// NOTE: this operator does never check if current status is done or not
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
...
...
@@ -688,6 +783,15 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
size_t
total
=
taosArrayGetSize
(
pInfo
->
pBlockLists
);
if
(
pInfo
->
blockType
==
STREAM_DATA_TYPE_SSDATA_BLOCK
)
{
if
(
pInfo
->
scanMode
==
STREAM_SCAN_FROM_UPDATERES
)
{
SSDataBlock
*
pDB
=
getDataFromCatch
(
pInfo
);
if
(
pDB
!=
NULL
)
{
return
pDB
;
}
else
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_READERHANDLE
;
}
}
if
(
pInfo
->
validBlockIndex
>=
total
)
{
doClearBufferedBlocks
(
pInfo
);
pOperator
->
status
=
OP_EXEC_DONE
;
...
...
@@ -695,7 +799,17 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
}
int32_t
current
=
pInfo
->
validBlockIndex
++
;
return
taosArrayGetP
(
pInfo
->
pBlockLists
,
current
);
SSDataBlock
*
pBlock
=
taosArrayGetP
(
pInfo
->
pBlockLists
,
current
);
if
(
pBlock
->
info
.
type
==
STREAM_REPROCESS
)
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_UPDATERES
;
}
else
{
int32_t
code
=
catchDatablock
(
pBlock
,
&
pInfo
->
childAggSup
,
pInfo
->
primaryTsIndex
,
0
);
if
(
code
!=
TDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
code
;
longjmp
(
pTaskInfo
->
env
,
code
);
}
}
return
pBlock
;
}
else
{
if
(
pInfo
->
scanMode
==
STREAM_SCAN_FROM_RES
)
{
blockDataDestroy
(
pInfo
->
pUpdateRes
);
...
...
@@ -857,6 +971,10 @@ SOperatorInfo* createStreamScanOperatorInfo(void* streamReadHandle, void* pDataR
pInfo
->
pOperatorDumy
=
pOperatorDumy
;
pInfo
->
interval
=
pSTInfo
->
interval
;
size_t
childKeyBufSize
=
sizeof
(
int64_t
)
+
sizeof
(
int64_t
)
+
sizeof
(
TSKEY
);
initCatchSupporter
(
&
pInfo
->
childAggSup
,
1024
,
childKeyBufSize
,
"StreamFinalInterval"
,
"/tmp/"
);
// TODO(liuyao) get row size from phy plan
pOperator
->
name
=
"StreamBlockScanOperator"
;
pOperator
->
operatorType
=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
;
pOperator
->
blocking
=
false
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
aa2faab1
...
...
@@ -8,6 +8,8 @@ typedef enum SResultTsInterpType {
RESULT_ROW_END_INTERP
=
2
,
}
SResultTsInterpType
;
static
SSDataBlock
*
doStreamFinalIntervalAgg
(
SOperatorInfo
*
pOperator
);
/*
* There are two cases to handle:
*
...
...
@@ -473,8 +475,7 @@ static bool setTimeWindowInterpolationEndTs(SOperatorInfo* pOperatorInfo, SqlFun
}
static
int32_t
getNextQualifiedWindow
(
SInterval
*
pInterval
,
STimeWindow
*
pNext
,
SDataBlockInfo
*
pDataBlockInfo
,
TSKEY
*
primaryKeys
,
int32_t
prevPosition
,
SIntervalAggOperatorInfo
*
pInfo
)
{
int32_t
order
=
pInfo
->
order
;
TSKEY
*
primaryKeys
,
int32_t
prevPosition
,
int32_t
order
)
{
bool
ascQuery
=
(
order
==
TSDB_ORDER_ASC
);
int32_t
precision
=
pInterval
->
precision
;
...
...
@@ -723,7 +724,7 @@ static SArray* hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pRe
STimeWindow
nextWin
=
win
;
while
(
1
)
{
int32_t
prevEndPos
=
(
forwardStep
-
1
)
*
step
+
startPos
;
startPos
=
getNextQualifiedWindow
(
&
pInfo
->
interval
,
&
nextWin
,
&
pSDataBlock
->
info
,
tsCols
,
prevEndPos
,
pInfo
);
startPos
=
getNextQualifiedWindow
(
&
pInfo
->
interval
,
&
nextWin
,
&
pSDataBlock
->
info
,
tsCols
,
prevEndPos
,
pInfo
->
order
);
if
(
startPos
<
0
)
{
break
;
}
...
...
@@ -1031,18 +1032,41 @@ static void setInverFunction(SqlFunctionCtx* pCtx, int32_t num, EStreamType type
}
}
}
static
void
doClearWindows
(
SIntervalAggOperatorInfo
*
pInfo
,
int32_t
numOfOutput
,
SSDataBlock
*
pBlock
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
void
doClearWindow
(
SAggSupporter
*
pSup
,
SOptrBasicInfo
*
pBinfo
,
char
*
pData
,
int16_t
bytes
,
uint64_t
groupId
,
int32_t
numOfOutput
)
{
SET_RES_WINDOW_KEY
(
pSup
->
keyBuf
,
pData
,
bytes
,
groupId
);
SResultRowPosition
*
p1
=
(
SResultRowPosition
*
)
taosHashGet
(
pSup
->
pResultRowHashTable
,
pSup
->
keyBuf
,
GET_RES_WINDOW_KEY_LEN
(
bytes
));
SResultRow
*
pResult
=
getResultRowByPos
(
pSup
->
pResultBuf
,
p1
);
SqlFunctionCtx
*
pCtx
=
pBinfo
->
pCtx
;
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
pCtx
[
i
].
resultInfo
=
getResultCell
(
pResult
,
i
,
pBinfo
->
rowCellInfoOffset
);
struct
SResultRowEntryInfo
*
pResInfo
=
pCtx
[
i
].
resultInfo
;
if
(
fmIsWindowPseudoColumnFunc
(
pCtx
[
i
].
functionId
))
{
continue
;
}
pResInfo
->
initialized
=
false
;
if
(
pCtx
[
i
].
functionId
!=
-
1
)
{
pCtx
[
i
].
fpSet
.
init
(
&
pCtx
[
i
],
pResInfo
);
}
}
}
static
void
doClearWindows
(
SAggSupporter
*
pSup
,
SOptrBasicInfo
*
pBinfo
,
SInterval
*
pIntrerval
,
int32_t
tsIndex
,
int32_t
numOfOutput
,
SSDataBlock
*
pBlock
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
tsIndex
);
TSKEY
*
tsCols
=
(
TSKEY
*
)
pColDataInfo
->
pData
;
int32_t
step
=
0
;
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
rows
;
i
+=
step
)
{
SResultRowInfo
dumyInfo
;
dumyInfo
.
cur
.
pageId
=
-
1
;
STimeWindow
win
=
getActiveTimeWindow
(
NULL
,
&
dumyInfo
,
tsCols
[
i
],
&
pInfo
->
int
erval
,
pIn
fo
->
interval
.
precision
,
NULL
);
STimeWindow
win
=
getActiveTimeWindow
(
NULL
,
&
dumyInfo
,
tsCols
[
i
],
pIntr
erval
,
pIn
trerval
->
precision
,
NULL
);
step
=
getNumOfRowsInTimeWindow
(
&
pBlock
->
info
,
tsCols
,
i
,
win
.
ekey
,
binarySearchForKey
,
NULL
,
TSDB_ORDER_ASC
);
doClearWindow
(
p
I
nfo
,
(
char
*
)
&
win
.
skey
,
sizeof
(
TKEY
),
pBlock
->
info
.
groupId
,
numOfOutput
);
doClearWindow
(
p
Sup
,
pBi
nfo
,
(
char
*
)
&
win
.
skey
,
sizeof
(
TKEY
),
pBlock
->
info
.
groupId
,
numOfOutput
);
}
}
...
...
@@ -1084,7 +1108,8 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
setInverFunction
(
pInfo
->
binfo
.
pCtx
,
pOperator
->
numOfExprs
,
pBlock
->
info
.
type
);
}
if
(
pBlock
->
info
.
type
==
STREAM_REPROCESS
)
{
doClearWindows
(
pInfo
,
pOperator
->
numOfExprs
,
pBlock
);
doClearWindows
(
&
pInfo
->
aggSup
,
&
pInfo
->
binfo
,
&
pInfo
->
interval
,
pInfo
->
primaryTsIndex
,
pOperator
->
numOfExprs
,
pBlock
);
continue
;
}
pInfo
->
order
=
TSDB_ORDER_ASC
;
...
...
@@ -1097,8 +1122,6 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
doBuildResultDatablock
(
pOperator
,
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pInfo
->
aggSup
.
pResultBuf
);
// TODO: remove for stream
/*ASSERT(pInfo->binfo.pRes->info.rows > 0);*/
pOperator
->
status
=
OP_RES_TO_RETURN
;
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
...
...
@@ -1116,6 +1139,12 @@ void destroyIntervalOperatorInfo(void* param, int32_t numOfOutput) {
cleanupAggSup
(
&
pInfo
->
aggSup
);
}
void
destroyStreamFinalIntervalOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
SStreamFinalIntervalOperatorInfo
*
pInfo
=
(
SStreamFinalIntervalOperatorInfo
*
)
param
;
doDestroyBasicInfo
(
&
pInfo
->
binfo
,
numOfOutput
);
cleanupAggSup
(
&
pInfo
->
aggSup
);
}
bool
allInvertible
(
SqlFunctionCtx
*
pFCtx
,
int32_t
numOfCols
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
i
++
)
{
if
(
!
fmIsInvertible
(
pFCtx
[
i
].
functionId
))
{
...
...
@@ -1185,6 +1214,63 @@ _error:
return
NULL
;
}
SOperatorInfo
*
createStreamFinalIntervalOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
SInterval
*
pInterval
,
int32_t
primaryTsSlotId
,
STimeWindowAggSupp
*
pTwAggSupp
,
const
STableGroupInfo
*
pTableGroupInfo
,
SExecTaskInfo
*
pTaskInfo
)
{
SStreamFinalIntervalOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamFinalIntervalOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
goto
_error
;
}
pInfo
->
order
=
TSDB_ORDER_ASC
;
pInfo
->
interval
=
*
pInterval
;
pInfo
->
twAggSup
=
*
pTwAggSupp
;
pInfo
->
primaryTsIndex
=
primaryTsSlotId
;
size_t
keyBufSize
=
sizeof
(
int64_t
)
+
sizeof
(
int64_t
)
+
POINTER_BYTES
;
initResultSizeInfo
(
pOperator
,
4096
);
int32_t
code
=
initAggInfo
(
&
pInfo
->
binfo
,
&
pInfo
->
aggSup
,
pExprInfo
,
numOfCols
,
pResBlock
,
keyBufSize
,
pTaskInfo
->
id
.
str
);
initExecTimeWindowInfo
(
&
pInfo
->
twAggSup
.
timeWindowData
,
&
pTaskInfo
->
window
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
initResultRowInfo
(
&
pInfo
->
binfo
.
resultRowInfo
,
(
int32_t
)
1
);
pOperator
->
name
=
"StreamFinalIntervalOperator"
;
pOperator
->
operatorType
=
QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL
;
pOperator
->
blocking
=
true
;
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
pExpr
=
pExprInfo
;
pOperator
->
pTaskInfo
=
pTaskInfo
;
pOperator
->
numOfExprs
=
numOfCols
;
pOperator
->
info
=
pInfo
;
pOperator
->
fpSet
=
createOperatorFpSet
(
NULL
,
doStreamFinalIntervalAgg
,
NULL
,
NULL
,
destroyStreamFinalIntervalOperatorInfo
,
aggEncodeResultRow
,
aggDecodeResultRow
,
NULL
);
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
return
pOperator
;
_error:
destroyStreamFinalIntervalOperatorInfo
(
pInfo
,
numOfCols
);
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
pTaskInfo
->
code
=
code
;
return
NULL
;
}
SOperatorInfo
*
createStreamIntervalOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
SInterval
*
pInterval
,
int32_t
primaryTsSlotId
,
STimeWindowAggSupp
*
pTwAggSupp
,
const
STableGroupInfo
*
pTableGroupInfo
,
...
...
@@ -1548,3 +1634,91 @@ _error:
pTaskInfo
->
code
=
code
;
return
NULL
;
}
static
SArray
*
doHashInterval
(
SOperatorInfo
*
pOperatorInfo
,
SResultRowInfo
*
pResultRowInfo
,
SSDataBlock
*
pSDataBlock
,
int32_t
tableGroupId
)
{
SStreamFinalIntervalOperatorInfo
*
pInfo
=
(
SStreamFinalIntervalOperatorInfo
*
)
pOperatorInfo
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperatorInfo
->
pTaskInfo
;
int32_t
numOfOutput
=
pOperatorInfo
->
numOfExprs
;
SArray
*
pUpdated
=
taosArrayInit
(
4
,
POINTER_BYTES
);
int32_t
step
=
1
;
bool
ascScan
=
true
;
TSKEY
*
tsCols
=
NULL
;
SResultRow
*
pResult
=
NULL
;
int32_t
forwardStep
=
0
;
if
(
pSDataBlock
->
pDataBlock
!=
NULL
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
tsCols
=
(
int64_t
*
)
pColDataInfo
->
pData
;
}
int32_t
startPos
=
ascScan
?
0
:
(
pSDataBlock
->
info
.
rows
-
1
);
TSKEY
ts
=
getStartTsKey
(
&
pSDataBlock
->
info
.
window
,
tsCols
,
pSDataBlock
->
info
.
rows
,
ascScan
);
STimeWindow
nextWin
=
getActiveTimeWindow
(
pInfo
->
aggSup
.
pResultBuf
,
pResultRowInfo
,
ts
,
&
pInfo
->
interval
,
pInfo
->
interval
.
precision
,
NULL
);
while
(
1
)
{
int32_t
code
=
setTimeWindowOutputBuf
(
pResultRowInfo
,
&
nextWin
,
true
,
&
pResult
,
tableGroupId
,
pInfo
->
binfo
.
pCtx
,
numOfOutput
,
pInfo
->
binfo
.
rowCellInfoOffset
,
&
pInfo
->
aggSup
,
pTaskInfo
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
pResult
==
NULL
)
{
longjmp
(
pTaskInfo
->
env
,
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
SResKeyPos
*
pos
=
taosMemoryMalloc
(
sizeof
(
SResKeyPos
)
+
sizeof
(
uint64_t
));
pos
->
groupId
=
tableGroupId
;
pos
->
pos
=
(
SResultRowPosition
){.
pageId
=
pResult
->
pageId
,
.
offset
=
pResult
->
offset
};
*
(
int64_t
*
)
pos
->
key
=
pResult
->
win
.
skey
;
taosArrayPush
(
pUpdated
,
&
pos
);
forwardStep
=
getNumOfRowsInTimeWindow
(
&
pSDataBlock
->
info
,
tsCols
,
startPos
,
nextWin
.
ekey
,
binarySearchForKey
,
NULL
,
TSDB_ORDER_ASC
);
// window start(end) key interpolation
doWindowBorderInterpolation
(
pOperatorInfo
,
pSDataBlock
,
pInfo
->
binfo
.
pCtx
,
pResult
,
&
nextWin
,
startPos
,
forwardStep
,
pInfo
->
order
,
false
);
updateTimeWindowInfo
(
&
pInfo
->
twAggSup
.
timeWindowData
,
&
nextWin
,
true
);
doApplyFunctions
(
pTaskInfo
,
pInfo
->
binfo
.
pCtx
,
&
nextWin
,
&
pInfo
->
twAggSup
.
timeWindowData
,
startPos
,
forwardStep
,
tsCols
,
pSDataBlock
->
info
.
rows
,
numOfOutput
,
TSDB_ORDER_ASC
);
int32_t
prevEndPos
=
(
forwardStep
-
1
)
*
step
+
startPos
;
startPos
=
getNextQualifiedWindow
(
&
pInfo
->
interval
,
&
nextWin
,
&
pSDataBlock
->
info
,
tsCols
,
prevEndPos
,
pInfo
->
order
);
if
(
startPos
<
0
)
{
break
;
}
}
return
pUpdated
;
}
static
SSDataBlock
*
doStreamFinalIntervalAgg
(
SOperatorInfo
*
pOperator
)
{
SStreamFinalIntervalOperatorInfo
*
pInfo
=
pOperator
->
info
;
SOperatorInfo
*
downstream
=
pOperator
->
pDownstream
[
0
];
SArray
*
pUpdated
=
NULL
;
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
}
else
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
doBuildResultDatablock
(
pOperator
,
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pInfo
->
aggSup
.
pResultBuf
);
if
(
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pInfo
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
}
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
}
while
(
1
)
{
publishOperatorProfEvent
(
downstream
,
QUERY_PROF_BEFORE_OPERATOR_EXEC
);
SSDataBlock
*
pBlock
=
downstream
->
fpSet
.
getNextFn
(
downstream
);
publishOperatorProfEvent
(
downstream
,
QUERY_PROF_AFTER_OPERATOR_EXEC
);
if
(
pBlock
==
NULL
)
{
break
;
}
setInputDataBlock
(
pOperator
,
pInfo
->
binfo
.
pCtx
,
pBlock
,
pInfo
->
order
,
MAIN_SCAN
,
true
);
if
(
pBlock
->
info
.
type
==
STREAM_REPROCESS
)
{
doClearWindows
(
&
pInfo
->
aggSup
,
&
pInfo
->
binfo
,
&
pInfo
->
interval
,
pInfo
->
primaryTsIndex
,
pOperator
->
numOfExprs
,
pBlock
);
continue
;
}
pUpdated
=
doHashInterval
(
pOperator
,
&
pInfo
->
binfo
.
resultRowInfo
,
pBlock
,
0
);
}
finalizeUpdatedResult
(
pOperator
->
numOfExprs
,
pInfo
->
aggSup
.
pResultBuf
,
pUpdated
,
pInfo
->
binfo
.
rowCellInfoOffset
);
initMultiResInfoFromArrayList
(
&
pInfo
->
groupResInfo
,
pUpdated
);
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
doBuildResultDatablock
(
pOperator
,
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pInfo
->
aggSup
.
pResultBuf
);
pOperator
->
status
=
OP_RES_TO_RETURN
;
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
}
source/libs/function/inc/builtinsimpl.h
浏览文件 @
aa2faab1
...
...
@@ -74,6 +74,7 @@ int32_t diffFunction(SqlFunctionCtx *pCtx);
bool
getFirstLastFuncEnv
(
struct
SFunctionNode
*
pFunc
,
SFuncExecEnv
*
pEnv
);
int32_t
firstFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
lastFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
lastFinalize
(
SqlFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
);
bool
getTopBotFuncEnv
(
SFunctionNode
*
UNUSED_PARAM
(
pFunc
),
SFuncExecEnv
*
pEnv
);
int32_t
topFunction
(
SqlFunctionCtx
*
pCtx
);
...
...
source/libs/function/src/builtins.c
浏览文件 @
aa2faab1
...
...
@@ -47,8 +47,10 @@ static int32_t translateInOutNum(SFunctionNode* pFunc, char* pErrBuf, int32_t le
}
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_NUMERIC_TYPE
(
paraType
))
{
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_NULL_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
else
if
(
IS_NULL_TYPE
(
paraType
))
{
paraType
=
TSDB_DATA_TYPE_BIGINT
;
}
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
tDataTypes
[
paraType
].
bytes
,
.
type
=
paraType
};
...
...
@@ -62,7 +64,7 @@ static int32_t translateInNumOutDou(SFunctionNode* pFunc, char* pErrBuf, int32_t
}
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_NUMERIC_TYPE
(
paraType
))
{
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_NULL_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
...
...
@@ -115,18 +117,19 @@ static int32_t translateSum(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
}
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_NUMERIC_TYPE
(
paraType
))
{
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_NULL_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
uint8_t
resType
=
0
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
paraType
)
||
paraType
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
paraType
)
||
TSDB_DATA_TYPE_BOOL
==
paraType
||
IS_NULL_TYPE
(
paraType
)
)
{
resType
=
TSDB_DATA_TYPE_BIGINT
;
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
paraType
))
{
resType
=
TSDB_DATA_TYPE_UBIGINT
;
}
else
if
(
IS_FLOAT_TYPE
(
paraType
))
{
resType
=
TSDB_DATA_TYPE_DOUBLE
;
}
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
tDataTypes
[
resType
].
bytes
,
.
type
=
resType
};
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -872,7 +875,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.
getEnvFunc
=
getFirstLastFuncEnv
,
.
initFunc
=
functionSetup
,
.
processFunc
=
lastFunction
,
.
finalizeFunc
=
function
Finalize
.
finalizeFunc
=
last
Finalize
},
{
.
name
=
"diff"
,
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
aa2faab1
...
...
@@ -255,7 +255,7 @@ int32_t functionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
SColumnInfoData
*
pCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
slotId
);
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
pResInfo
->
isNullRes
=
(
pResInfo
->
numOfRes
==
0
)
?
1
:
0
;
//
pResInfo->isNullRes = (pResInfo->numOfRes == 0) ? 1 : 0;
char
*
in
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
colDataAppend
(
pCol
,
pBlock
->
info
.
rows
,
in
,
pResInfo
->
isNullRes
);
...
...
@@ -331,8 +331,18 @@ static FORCE_INLINE int32_t getNumofElem(SqlFunctionCtx* pCtx) {
int32_t
countFunction
(
SqlFunctionCtx
*
pCtx
)
{
int32_t
numOfElem
=
getNumofElem
(
pCtx
);
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
SInputColumnInfoData
*
pInput
=
&
pCtx
->
input
;
int32_t
type
=
pInput
->
pData
[
0
]
->
info
.
type
;
char
*
buf
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
if
(
IS_NULL_TYPE
(
type
))
{
//select count(NULL) returns 0
numOfElem
=
1
;
*
((
int64_t
*
)
buf
)
=
0
;
}
else
{
*
((
int64_t
*
)
buf
)
+=
numOfElem
;
}
SET_VAL
(
pResInfo
,
numOfElem
,
1
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -383,6 +393,12 @@ int32_t sumFunction(SqlFunctionCtx* pCtx) {
SSumRes
*
pSumRes
=
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
if
(
IS_NULL_TYPE
(
type
))
{
GET_RES_INFO
(
pCtx
)
->
isNullRes
=
1
;
numOfElem
=
1
;
goto
_sum_over
;
}
if
(
pInput
->
colDataAggIsSet
)
{
numOfElem
=
pInput
->
numOfRows
-
pAgg
->
numOfNull
;
ASSERT
(
numOfElem
>=
0
);
...
...
@@ -427,6 +443,7 @@ int32_t sumFunction(SqlFunctionCtx* pCtx) {
}
}
_sum_over:
// data in the check operation are all null, not output
SET_VAL
(
GET_RES_INFO
(
pCtx
),
numOfElem
,
1
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -526,6 +543,12 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
numOfRows
=
pInput
->
numOfRows
;
if
(
IS_NULL_TYPE
(
type
))
{
GET_RES_INFO
(
pCtx
)
->
isNullRes
=
1
;
numOfElem
=
1
;
goto
_avg_over
;
}
switch
(
type
)
{
case
TSDB_DATA_TYPE_TINYINT
:
{
int8_t
*
plist
=
(
int8_t
*
)
pCol
->
pData
;
...
...
@@ -617,6 +640,7 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) {
break
;
}
_avg_over:
// data in the check operation are all null, not output
SET_VAL
(
GET_RES_INFO
(
pCtx
),
numOfElem
,
1
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -783,6 +807,12 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
SMinmaxResInfo
*
pBuf
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
if
(
IS_NULL_TYPE
(
type
))
{
GET_RES_INFO
(
pCtx
)
->
isNullRes
=
1
;
numOfElems
=
1
;
goto
_min_max_over
;
}
// data in current data block are qualified to the query
if
(
pInput
->
colDataAggIsSet
)
{
numOfElems
=
pInput
->
numOfRows
-
pAgg
->
numOfNull
;
...
...
@@ -1183,6 +1213,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
}
}
_min_max_over:
return
numOfElems
;
}
...
...
@@ -1215,9 +1246,9 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
if
(
pCol
->
info
.
type
==
TSDB_DATA_TYPE_FLOAT
)
{
float
v
=
*
(
double
*
)
&
pRes
->
v
;
colDataAppend
(
pCol
,
currentRow
,
(
const
char
*
)
&
v
,
false
);
colDataAppend
(
pCol
,
currentRow
,
(
const
char
*
)
&
v
,
pEntryInfo
->
isNullRes
);
}
else
{
colDataAppend
(
pCol
,
currentRow
,
(
const
char
*
)
&
pRes
->
v
,
false
);
colDataAppend
(
pCol
,
currentRow
,
(
const
char
*
)
&
pRes
->
v
,
pEntryInfo
->
isNullRes
);
}
setSelectivityValue
(
pCtx
,
pBlock
,
&
pRes
->
tuplePos
,
currentRow
);
...
...
@@ -1287,6 +1318,12 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
numOfRows
=
pInput
->
numOfRows
;
if
(
IS_NULL_TYPE
(
type
))
{
GET_RES_INFO
(
pCtx
)
->
isNullRes
=
1
;
numOfElem
=
1
;
goto
_stddev_over
;
}
switch
(
type
)
{
case
TSDB_DATA_TYPE_TINYINT
:
{
int8_t
*
plist
=
(
int8_t
*
)
pCol
->
pData
;
...
...
@@ -1384,6 +1421,7 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) {
break
;
}
_stddev_over:
// data in the check operation are all null, not output
SET_VAL
(
GET_RES_INFO
(
pCtx
),
numOfElem
,
1
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1943,6 +1981,19 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
lastFinalize
(
SqlFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
)
{
int32_t
slotId
=
pCtx
->
pExpr
->
base
.
resSchema
.
slotId
;
SColumnInfoData
*
pCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
slotId
);
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
pResInfo
->
isNullRes
=
(
pResInfo
->
numOfRes
==
0
)
?
1
:
0
;
char
*
in
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
colDataAppend
(
pCol
,
pBlock
->
info
.
rows
,
in
,
pResInfo
->
isNullRes
);
return
pResInfo
->
numOfRes
;
}
bool
getDiffFuncEnv
(
SFunctionNode
*
UNUSED_PARAM
(
pFunc
),
SFuncExecEnv
*
pEnv
)
{
pEnv
->
calcMemSize
=
sizeof
(
SDiffInfo
);
return
true
;
...
...
source/libs/function/src/tudf.c
浏览文件 @
aa2faab1
...
...
@@ -1364,9 +1364,12 @@ void releaseUdfFuncHandle(char* udfName) {
SUdfcFuncStub
key
=
{
0
};
strcpy
(
key
.
udfName
,
udfName
);
SUdfcFuncStub
*
foundStub
=
taosArraySearch
(
gUdfdProxy
.
udfStubs
,
&
key
,
compareUdfcFuncSub
,
TD_EQ
);
ASSERT
(
foundStub
);
if
(
!
foundStub
)
{
return
;
}
if
(
foundStub
->
refCount
>
0
)
{
--
foundStub
->
refCount
;
ASSERT
(
foundStub
->
refCount
>=
0
);
}
uv_mutex_unlock
(
&
gUdfdProxy
.
udfStubsMutex
);
}
...
...
@@ -1377,7 +1380,7 @@ int32_t cleanUpUdfs() {
while
(
i
<
taosArrayGetSize
(
gUdfdProxy
.
udfStubs
))
{
SUdfcFuncStub
*
stub
=
taosArrayGet
(
gUdfdProxy
.
udfStubs
,
i
);
if
(
stub
->
refCount
==
0
)
{
fnInfo
(
"tear down udf. udf name: %s, handle: %p
"
,
stub
->
udfName
,
stub
->
handle
);
fnInfo
(
"tear down udf. udf name: %s, handle: %p
, ref count: %d"
,
stub
->
udfName
,
stub
->
handle
,
stub
->
refCount
);
doTeardownUdf
(
stub
->
handle
);
}
else
{
fnInfo
(
"udf still in use. udf name: %s, ref count: %d, last ref time: %"
PRId64
", handle: %p"
,
...
...
@@ -1530,12 +1533,15 @@ int32_t callUdfScalarFunc(char *udfName, SScalarParam *input, int32_t numOfCols,
}
SUdfcUvSession
*
session
=
handle
;
code
=
doCallUdfScalarFunc
(
handle
,
input
,
numOfCols
,
output
);
if
(
session
->
outputType
!=
output
->
columnData
->
info
.
type
||
session
->
outputLen
!=
output
->
columnData
->
info
.
bytes
)
{
fnError
(
"udfc scalar function calculate error, session type: %d(%d), output type: %d(%d)"
,
session
->
outputType
,
session
->
outputLen
,
output
->
columnData
->
info
.
type
,
output
->
columnData
->
info
.
bytes
);
if
(
output
->
columnData
==
NULL
)
{
fnError
(
"udfc scalar function calculate error. no column data"
);
code
=
TSDB_CODE_UDF_INVALID_OUTPUT_TYPE
;
}
else
{
if
(
session
->
outputType
!=
output
->
columnData
->
info
.
type
||
session
->
outputLen
!=
output
->
columnData
->
info
.
bytes
)
{
fnError
(
"udfc scalar function calculate error. type mismatch. session type: %d(%d), output type: %d(%d)"
,
session
->
outputType
,
session
->
outputLen
,
output
->
columnData
->
info
.
type
,
output
->
columnData
->
info
.
bytes
);
code
=
TSDB_CODE_UDF_INVALID_OUTPUT_TYPE
;
}
}
releaseUdfFuncHandle
(
udfName
);
return
code
;
...
...
@@ -1565,7 +1571,7 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
fnInfo
(
"tear down udf. udf name: %s, udf func handle: %p"
,
session
->
udfName
,
handle
);
taosMemoryFree
(
task
->
session
);
taosMemoryFree
(
session
);
taosMemoryFree
(
task
);
return
err
;
...
...
@@ -1573,7 +1579,6 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
//memory layout |---SUdfAggRes----|-----final result-----|---inter result----|
typedef
struct
SUdfAggRes
{
SUdfcUvSession
*
session
;
int8_t
finalResNum
;
int8_t
interResNum
;
char
*
finalResBuf
;
...
...
@@ -1606,7 +1611,6 @@ bool udfAggInit(struct SqlFunctionCtx *pCtx, struct SResultRowEntryInfo* pResult
udfRes
->
finalResBuf
=
(
char
*
)
udfRes
+
sizeof
(
SUdfAggRes
);
udfRes
->
interResBuf
=
(
char
*
)
udfRes
+
sizeof
(
SUdfAggRes
)
+
session
->
outputLen
;
udfRes
->
session
=
(
SUdfcUvSession
*
)
handle
;
SUdfInterBuf
buf
=
{
0
};
if
((
udfCode
=
doCallUdfAggInit
(
handle
,
&
buf
))
!=
0
)
{
fnError
(
"udfAggInit error. step doCallUdfAggInit. udf code: %d"
,
udfCode
);
...
...
@@ -1621,22 +1625,26 @@ bool udfAggInit(struct SqlFunctionCtx *pCtx, struct SResultRowEntryInfo* pResult
releaseUdfFuncHandle
(
pCtx
->
udfName
);
return
false
;
}
releaseUdfFuncHandle
(
pCtx
->
udfName
);
freeUdfInterBuf
(
&
buf
);
return
true
;
}
int32_t
udfAggProcess
(
struct
SqlFunctionCtx
*
pCtx
)
{
SInputColumnInfoData
*
pInput
=
&
pCtx
->
input
;
int32_t
numOfCols
=
pInput
->
numOfInputCols
;
int32_t
udfCode
=
0
;
UdfcFuncHandle
handle
=
0
;
if
((
udfCode
=
acquireUdfFuncHandle
((
char
*
)
pCtx
->
udfName
,
&
handle
))
!=
0
)
{
fnError
(
"udfAggProcess error. step acquireUdfFuncHandle. udf code: %d"
,
udfCode
);
return
udfCode
;
}
SUdfcUvSession
*
session
=
handle
;
SUdfAggRes
*
udfRes
=
(
SUdfAggRes
*
)
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
SUdfcUvSession
*
session
=
udfRes
->
session
;
if
(
session
==
NULL
)
{
return
TSDB_CODE_UDF_NO_FUNC_HANDLE
;
}
udfRes
->
finalResBuf
=
(
char
*
)
udfRes
+
sizeof
(
SUdfAggRes
);
udfRes
->
interResBuf
=
(
char
*
)
udfRes
+
sizeof
(
SUdfAggRes
)
+
session
->
outputLen
;
SInputColumnInfoData
*
pInput
=
&
pCtx
->
input
;
int32_t
numOfCols
=
pInput
->
numOfInputCols
;
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
numOfRows
=
pInput
->
numOfRows
;
...
...
@@ -1664,7 +1672,7 @@ int32_t udfAggProcess(struct SqlFunctionCtx *pCtx) {
.
numOfResult
=
udfRes
->
interResNum
};
SUdfInterBuf
newState
=
{
0
};
int32_t
udfCode
=
doCallUdfAggProcess
(
session
,
inputBlock
,
&
state
,
&
newState
);
udfCode
=
doCallUdfAggProcess
(
session
,
inputBlock
,
&
state
,
&
newState
);
if
(
udfCode
!=
0
)
{
fnError
(
"udfAggProcess error. code: %d"
,
udfCode
);
newState
.
numOfResult
=
0
;
...
...
@@ -1684,19 +1692,21 @@ int32_t udfAggProcess(struct SqlFunctionCtx *pCtx) {
blockDataDestroy
(
inputBlock
);
taosArrayDestroy
(
tempBlock
.
pDataBlock
);
if
(
udfCode
!=
0
)
{
releaseUdfFuncHandle
(
pCtx
->
udfName
);
}
freeUdfInterBuf
(
&
newState
);
return
udfCode
;
}
int32_t
udfAggFinalize
(
struct
SqlFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
)
{
SUdfAggRes
*
udfRes
=
(
SUdfAggRes
*
)
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
SUdfcUvSession
*
session
=
udfRes
->
session
;
if
(
session
==
NULL
)
{
return
TSDB_CODE_UDF_NO_FUNC_HANDLE
;
int32_t
udfCode
=
0
;
UdfcFuncHandle
handle
=
0
;
if
((
udfCode
=
acquireUdfFuncHandle
((
char
*
)
pCtx
->
udfName
,
&
handle
))
!=
0
)
{
fnError
(
"udfAggProcess error. step acquireUdfFuncHandle. udf code: %d"
,
udfCode
);
return
udfCode
;
}
SUdfcUvSession
*
session
=
handle
;
SUdfAggRes
*
udfRes
=
(
SUdfAggRes
*
)
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
udfRes
->
finalResBuf
=
(
char
*
)
udfRes
+
sizeof
(
SUdfAggRes
);
udfRes
->
interResBuf
=
(
char
*
)
udfRes
+
sizeof
(
SUdfAggRes
)
+
session
->
outputLen
;
...
...
source/libs/parser/inc/sql.y
浏览文件 @
aa2faab1
...
...
@@ -621,6 +621,7 @@ column_reference(A) ::= table_name(B) NK_DOT column_name(C).
pseudo_column(A) ::= ROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= TBNAME(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= table_name(B) NK_DOT TBNAME(C). { A = createRawExprNodeExt(pCxt, &B, &C, createFunctionNode(pCxt, &C, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B)))); }
pseudo_column(A) ::= QSTARTTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= QENDTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
pseudo_column(A) ::= WSTARTTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); }
...
...
source/libs/parser/src/parAstCreater.c
浏览文件 @
aa2faab1
...
...
@@ -155,9 +155,9 @@ static bool checkPort(SAstCreateContext* pCxt, const SToken* pPortToken, int32_t
return
TSDB_CODE_SUCCESS
==
pCxt
->
errCode
;
}
static
bool
checkDbName
(
SAstCreateContext
*
pCxt
,
SToken
*
pDbName
,
bool
query
)
{
static
bool
checkDbName
(
SAstCreateContext
*
pCxt
,
SToken
*
pDbName
,
bool
demandDb
)
{
if
(
NULL
==
pDbName
)
{
if
(
query
&&
NULL
==
pCxt
->
pQueryCxt
->
db
)
{
if
(
demandDb
&&
NULL
==
pCxt
->
pQueryCxt
->
db
)
{
pCxt
->
errCode
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_DB_NOT_SPECIFIED
);
}
}
else
{
...
...
@@ -457,6 +457,8 @@ SNode* createTempTableNode(SAstCreateContext* pCxt, SNode* pSubquery, const STok
}
if
(
QUERY_NODE_SELECT_STMT
==
nodeType
(
pSubquery
))
{
strcpy
(((
SSelectStmt
*
)
pSubquery
)
->
stmtName
,
tempTable
->
table
.
tableAlias
);
}
else
if
(
QUERY_NODE_SET_OPERATOR
==
nodeType
(
pSubquery
))
{
strcpy
(((
SSetOperator
*
)
pSubquery
)
->
stmtName
,
tempTable
->
table
.
tableAlias
);
}
return
(
SNode
*
)
tempTable
;
}
...
...
@@ -637,6 +639,7 @@ SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode*
setOp
->
opType
=
type
;
setOp
->
pLeft
=
pLeft
;
setOp
->
pRight
=
pRight
;
sprintf
(
setOp
->
stmtName
,
"%p"
,
setOp
);
return
(
SNode
*
)
setOp
;
}
...
...
@@ -1140,7 +1143,7 @@ SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const
SNode
*
createCreateIndexStmt
(
SAstCreateContext
*
pCxt
,
EIndexType
type
,
bool
ignoreExists
,
SToken
*
pIndexName
,
SToken
*
pTableName
,
SNodeList
*
pCols
,
SNode
*
pOptions
)
{
if
(
!
checkIndexName
(
pCxt
,
pIndexName
)
||
!
checkTableName
(
pCxt
,
pTableName
))
{
if
(
!
checkIndexName
(
pCxt
,
pIndexName
)
||
!
checkTableName
(
pCxt
,
pTableName
)
||
!
checkDbName
(
pCxt
,
NULL
,
true
)
)
{
return
NULL
;
}
SCreateIndexStmt
*
pStmt
=
nodesMakeNode
(
QUERY_NODE_CREATE_INDEX_STMT
);
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
aa2faab1
...
...
@@ -766,6 +766,20 @@ static EDealRes translateFunction(STranslateContext* pCxt, SFunctionNode* pFunc)
pCxt
->
pCurrStmt
->
hasRepeatScanFuncs
=
true
;
}
}
if
(
TSDB_CODE_SUCCESS
==
pCxt
->
errCode
&&
fmIsScanPseudoColumnFunc
(
pFunc
->
funcId
))
{
if
(
0
==
LIST_LENGTH
(
pFunc
->
pParameterList
))
{
if
(
QUERY_NODE_REAL_TABLE
!=
nodeType
(
pCxt
->
pCurrStmt
->
pFromTable
))
{
return
generateDealNodeErrMsg
(
pCxt
,
TSDB_CODE_PAR_INVALID_TBNAME
);
}
}
else
{
SValueNode
*
pVal
=
nodesListGetNode
(
pFunc
->
pParameterList
,
0
);
STableNode
*
pTable
=
NULL
;
pCxt
->
errCode
=
findTable
(
pCxt
,
pVal
->
literal
,
&
pTable
);
if
(
TSDB_CODE_SUCCESS
==
pCxt
->
errCode
&&
(
NULL
==
pTable
||
QUERY_NODE_REAL_TABLE
!=
nodeType
(
pTable
)))
{
return
generateDealNodeErrMsg
(
pCxt
,
TSDB_CODE_PAR_INVALID_TBNAME
);
}
}
}
return
TSDB_CODE_SUCCESS
==
pCxt
->
errCode
?
DEAL_RES_CONTINUE
:
DEAL_RES_ERROR
;
}
...
...
@@ -1758,12 +1772,13 @@ static int32_t translateSelect(STranslateContext* pCxt, SSelectStmt* pSelect) {
return
code
;
}
static
SNode
*
createSetOperProject
(
SNode
*
pNode
)
{
static
SNode
*
createSetOperProject
(
const
char
*
pTableAlias
,
SNode
*
pNode
)
{
SColumnNode
*
pCol
=
nodesMakeNode
(
QUERY_NODE_COLUMN
);
if
(
NULL
==
pCol
)
{
return
NULL
;
}
pCol
->
node
.
resType
=
((
SExprNode
*
)
pNode
)
->
resType
;
strcpy
(
pCol
->
tableAlias
,
pTableAlias
);
strcpy
(
pCol
->
colName
,
((
SExprNode
*
)
pNode
)
->
aliasName
);
strcpy
(
pCol
->
node
.
aliasName
,
pCol
->
colName
);
return
(
SNode
*
)
pCol
;
...
...
@@ -1817,7 +1832,8 @@ static int32_t translateSetOperatorImpl(STranslateContext* pCxt, SSetOperator* p
}
strcpy
(
pRightExpr
->
aliasName
,
pLeftExpr
->
aliasName
);
pRightExpr
->
aliasName
[
strlen
(
pLeftExpr
->
aliasName
)]
=
'\0'
;
if
(
TSDB_CODE_SUCCESS
!=
nodesListMakeStrictAppend
(
&
pSetOperator
->
pProjectionList
,
createSetOperProject
(
pLeft
)))
{
if
(
TSDB_CODE_SUCCESS
!=
nodesListMakeStrictAppend
(
&
pSetOperator
->
pProjectionList
,
createSetOperProject
(
pSetOperator
->
stmtName
,
pLeft
)))
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
...
source/libs/parser/src/parUtil.c
浏览文件 @
aa2faab1
...
...
@@ -158,6 +158,8 @@ static char* getSyntaxErrFormat(int32_t errCode) {
return
"Primary timestamp column cannot be dropped"
;
case
TSDB_CODE_PAR_INVALID_MODIFY_COL
:
return
"Only binary/nchar column length could be modified"
;
case
TSDB_CODE_PAR_INVALID_TBNAME
:
return
"Invalid tbname pseudo column"
;
case
TSDB_CODE_OUT_OF_MEMORY
:
return
"Out of memory"
;
default:
...
...
source/libs/parser/src/sql.c
浏览文件 @
aa2faab1
...
...
@@ -134,17 +134,17 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
#define YYNSTATE 60
3
#define YYNRULE 45
1
#define YYNSTATE 60
5
#define YYNRULE 45
2
#define YYNTOKEN 238
#define YY_MAX_SHIFT 60
2
#define YY_MIN_SHIFTREDUCE 89
0
#define YY_MAX_SHIFTREDUCE 134
0
#define YY_ERROR_ACTION 134
1
#define YY_ACCEPT_ACTION 134
2
#define YY_NO_ACTION 134
3
#define YY_MIN_REDUCE 134
4
#define YY_MAX_REDUCE 179
4
#define YY_MAX_SHIFT 60
4
#define YY_MIN_SHIFTREDUCE 89
3
#define YY_MAX_SHIFTREDUCE 134
4
#define YY_ERROR_ACTION 134
5
#define YY_ACCEPT_ACTION 134
6
#define YY_NO_ACTION 134
7
#define YY_MIN_REDUCE 134
8
#define YY_MAX_REDUCE 179
9
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
...
...
@@ -213,223 +213,223 @@ typedef union {
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (2167)
static
const
YYACTIONTYPE
yy_action
[]
=
{
/* 0 */
38
2
,
76
,
383
,
1376
,
390
,
517
,
383
,
1376
,
1627
,
28
,
/* 10 */
22
1
,
1463
,
35
,
33
,
113
,
1459
,
342
,
346
,
1642
,
1772
,
/* 20 */
30
0
,
1466
,
1156
,
1623
,
1631
,
1629
,
36
,
34
,
32
,
31
,
/* 30 */
30
,
172
4
,
1771
,
1474
,
94
,
520
,
1769
,
93
,
92
,
91
,
/* 40 */
90
,
89
,
88
,
87
,
86
,
85
,
16
58
,
1154
,
1519
,
291
,
/* 50 */
32
,
31
,
30
,
50
1
,
290
,
1721
,
1772
,
477
,
14
,
1517
,
/* 60 */
35
,
33
,
128
1
,
500
,
1162
,
516
,
1627
,
1613
,
300
,
144
,
/* 70 */
115
6
,
348
,
273
,
1769
,
397
,
36
,
34
,
32
,
31
,
30
,
/* 80 */
1
,
162
3
,
1630
,
1629
,
1670
,
112
,
24
,
132
,
1643
,
503
,
/* 90 */
164
5
,
1646
,
499
,
520
,
520
,
1154
,
36
,
34
,
32
,
31
,
/* 100 */
30
,
61
,
599
,
1243
,
270
,
481
,
14
,
517
,
35
,
33
,
/* 110 */
59
5
,
594
,
1162
,
1155
,
108
,
516
,
300
,
304
,
1156
,
104
,
/* 120 */
11
78
,
273
,
1469
,
110
,
936
,
128
,
418
,
130
,
2
,
1356
,
/* 130 */
54
,
48
2
,
1786
,
1476
,
1772
,
1474
,
517
,
69
,
210
,
1717
,
/* 140 */
47
6
,
1344
,
475
,
1154
,
1193
,
1772
,
1772
,
145
,
104
,
416
,
/* 150 */
599
,
1769
,
1243
,
1244
,
14
,
423
,
1157
,
1467
,
146
,
1770
,
/* 160 */
116
2
,
1155
,
1769
,
1769
,
1474
,
103
,
102
,
101
,
100
,
99
,
/* 170 */
98
,
97
,
96
,
95
,
12
49
,
38
,
2
,
552
,
1160
,
1161
,
/* 180 */
54
,
120
6
,
1207
,
1208
,
1209
,
1210
,
1211
,
1212
,
496
,
518
,
/* 190 */
122
0
,
1221
,
1222
,
1223
,
1224
,
1225
,
551
,
550
,
599
,
549
,
/* 200 */
5
48
,
547
,
1244
,
493
,
1157
,
341
,
1305
,
340
,
147
,
1155
,
/* 210 */
27
,
29
8
,
1238
,
1239
,
1240
,
1241
,
1242
,
1246
,
1247
,
1248
,
/* 220 */
131
,
118
0
,
504
,
1249
,
1431
,
303
,
1160
,
1161
,
1564
,
1206
,
/* 230 */
12
07
,
1208
,
1209
,
1210
,
1211
,
1212
,
496
,
518
,
1220
,
1221
,
/* 240 */
122
2
,
1223
,
1224
,
1225
,
1403
,
464
,
1303
,
1304
,
1306
,
1307
,
/* 250 */
55
,
54
,
11
57
,
36
,
34
,
32
,
31
,
30
,
147
,
27
,
/* 260 */
29
8
,
1238
,
1239
,
1240
,
1241
,
1242
,
1246
,
1247
,
1248
,
63
,
/* 270 */
28
8
,
477
,
554
,
187
,
1160
,
1161
,
1342
,
1206
,
1207
,
1208
,
/* 280 */
12
09
,
1210
,
1211
,
1212
,
496
,
518
,
1220
,
1221
,
1222
,
1223
,
/* 290 */
122
4
,
1225
,
35
,
33
,
36
,
34
,
32
,
31
,
30
,
112
,
/* 300 */
30
0
,
1452
,
1156
,
147
,
575
,
574
,
573
,
315
,
147
,
572
,
/* 310 */
57
1
,
570
,
114
,
565
,
564
,
563
,
562
,
561
,
560
,
559
,
/* 320 */
5
58
,
121
,
1295
,
1235
,
1519
,
312
,
54
,
1154
,
988
,
1658
,
/* 330 */
30
5
,
1642
,
1555
,
1557
,
316
,
1517
,
501
,
110
,
138
,
310
,
/* 340 */
35
,
33
,
12
26
,
471
,
1162
,
990
,
920
,
128
,
300
,
1513
,
/* 350 */
115
6
,
479
,
140
,
1717
,
1718
,
1476
,
1722
,
26
,
397
,
1658
,
/* 360 */
8
,
36
,
34
,
32
,
31
,
30
,
50
1
,
36
,
34
,
32
,
/* 370 */
31
,
30
,
47
0
,
467
,
1772
,
1154
,
500
,
1406
,
313
,
147
,
/* 380 */
161
3
,
53
,
599
,
461
,
924
,
925
,
128
,
144
,
35
,
33
,
/* 390 */
33
3
,
1769
,
1162
,
1155
,
1476
,
516
,
300
,
1670
,
1156
,
1182
,
/* 400 */
26
7
,
1643
,
503
,
1645
,
1646
,
499
,
381
,
520
,
9
,
385
,
/* 410 */
33
5
,
331
,
1026
,
543
,
542
,
541
,
1030
,
540
,
1032
,
1033
,
/* 420 */
5
39
,
1035
,
536
,
1154
,
1041
,
533
,
1043
,
1044
,
530
,
527
,
/* 430 */
599
,
36
,
34
,
32
,
31
,
30
,
1157
,
432
,
431
,
12
8
,
/* 440 */
116
2
,
1155
,
430
,
472
,
468
,
109
,
427
,
1477
,
517
,
426
,
/* 450 */
42
5
,
424
,
1183
,
153
,
147
,
39
,
9
,
1724
,
1160
,
1161
,
/* 460 */
34
7
,
1206
,
1207
,
1208
,
1209
,
1210
,
1211
,
1212
,
496
,
518
,
/* 470 */
122
0
,
1221
,
1222
,
1223
,
1224
,
1225
,
1474
,
59
,
599
,
387
,
/* 480 */
58
,
1720
,
432
,
431
,
1157
,
1178
,
1465
,
430
,
147
,
1155
,
/* 490 */
109
,
42
7
,
1519
,
446
,
426
,
425
,
424
,
1337
,
311
,
546
,
/* 500 */
119
3
,
1156
,
1367
,
1517
,
372
,
454
,
1160
,
1161
,
308
,
1206
,
/* 510 */
12
07
,
1208
,
1209
,
1210
,
1211
,
1212
,
496
,
518
,
1220
,
1221
,
/* 520 */
122
2
,
1223
,
1224
,
1225
,
212
,
1627
,
1154
,
36
,
34
,
32
,
/* 530 */
31
,
30
,
11
57
,
1772
,
389
,
1613
,
1519
,
385
,
504
,
1366
,
/* 540 */
162
3
,
1630
,
1629
,
1162
,
1565
,
1365
,
144
,
1518
,
157
,
156
,
/* 550 */
17
69
,
1613
,
520
,
455
,
1160
,
1161
,
1642
,
1206
,
1207
,
1208
,
/* 560 */
12
09
,
1210
,
1211
,
1212
,
496
,
518
,
1220
,
1221
,
1222
,
1223
,
/* 570 */
122
4
,
1225
,
35
,
33
,
269
,
517
,
1178
,
198
,
1336
,
61
,
/* 580 */
30
0
,
599
,
1156
,
365
,
1658
,
517
,
377
,
357
,
1613
,
429
,
/* 590 */
428
,
501
,
1155
,
1772
,
1613
,
1364
,
173
,
514
,
1363
,
1362
,
/* 600 */
147
0
,
500
,
483
,
1474
,
378
,
1613
,
144
,
1154
,
137
,
517
,
/* 610 */
17
69
,
481
,
1361
,
1474
,
414
,
410
,
406
,
402
,
172
,
282
,
/* 620 */
1181
,
358
,
1670
,
1280
,
1162
,
258
,
1643
,
503
,
1645
,
1646
,
/* 630 */
499
,
517
,
520
,
1117
,
937
,
1157
,
936
,
1474
,
477
,
1450
,
/* 640 */
2
,
11
19
,
62
,
396
,
1613
,
170
,
1360
,
1613
,
1613
,
569
,
/* 650 */
567
,
1772
,
1179
,
11
,
10
,
1556
,
1557
,
1160
,
1161
,
1474
,
/* 660 */
127
,
161
3
,
599
,
938
,
146
,
1359
,
112
,
283
,
1769
,
281
,
/* 670 */
28
0
,
7
,
420
,
1155
,
376
,
1358
,
422
,
371
,
370
,
369
,
/* 680 */
36
8
,
367
,
364
,
363
,
362
,
361
,
360
,
356
,
355
,
354
,
/* 690 */
35
3
,
352
,
351
,
350
,
349
,
1613
,
554
,
517
,
517
,
421
,
/* 700 */
51
7
,
1118
,
485
,
169
,
110
,
164
,
1451
,
166
,
477
,
1471
,
/* 710 */
159
3
,
1355
,
515
,
1245
,
1613
,
1354
,
1157
,
1353
,
1352
,
141
,
/* 720 */
17
17
,
1718
,
444
,
1722
,
1613
,
1474
,
1474
,
162
,
1474
,
135
1
,
/* 730 */
164
2
,
1350
,
1349
,
1257
,
1250
,
442
,
112
,
1348
,
1160
,
1161
,
/* 740 */
422
,
1206
,
1207
,
1208
,
1209
,
1210
,
1211
,
1212
,
496
,
518
,
/* 750 */
122
0
,
1221
,
1222
,
1223
,
1224
,
1225
,
517
,
568
,
1658
,
517
,
/* 760 */
1
613
,
1347
,
1552
,
421
,
1613
,
501
,
1613
,
1613
,
235
,
155
,
/* 770 */
25
,
31
4
,
924
,
925
,
110
,
500
,
1729
,
1276
,
1613
,
1613
,
/* 780 */
161
3
,
1613
,
1288
,
1724
,
1474
,
481
,
1613
,
1474
,
1180
,
142
,
/* 790 */
17
17
,
1718
,
245
,
1722
,
1602
,
1504
,
1670
,
336
,
552
,
79
,
/* 800 */
164
3
,
503
,
1645
,
1646
,
499
,
1642
,
520
,
1719
,
178
,
1710
,
/* 810 */
161
3
,
176
,
180
,
272
,
1706
,
179
,
182
,
551
,
550
,
181
,
/* 820 */
5
49
,
548
,
547
,
1393
,
557
,
1772
,
1446
,
184
,
1279
,
1231
,
/* 830 */
183
,
1388
,
118
,
1658
,
1386
,
1180
,
1141
,
1142
,
146
,
323
,
/* 840 */
50
1
,
1276
,
1769
,
45
,
129
,
433
,
201
,
46
,
271
,
251
,
/* 850 */
50
0
,
11
,
10
,
435
,
1613
,
1633
,
438
,
1339
,
1340
,
37
,
/* 860 */
48
1
,
249
,
52
,
488
,
556
,
51
,
1642
,
1461
,
37
,
1457
,
/* 870 */
37
,
1670
,
456
,
190
,
79
,
1643
,
503
,
1645
,
1646
,
499
,
/* 880 */
43
7
,
520
,
158
,
1302
,
1710
,
224
,
203
,
486
,
272
,
1706
,
/* 890 */
116
,
1635
,
75
,
117
,
1658
,
445
,
495
,
545
,
1357
,
1251
,
/* 900 */
177
2
,
480
,
71
,
453
,
118
,
1165
,
54
,
1164
,
1213
,
186
,
/* 910 */
1
112
,
500
,
45
,
144
,
216
,
1613
,
1449
,
1769
,
1432
,
1642
,
/* 920 */
525
,
440
,
117
,
465
,
447
,
226
,
434
,
118
,
207
,
1377
,
/* 930 */
509
,
185
,
1670
,
232
,
415
,
80
,
1643
,
503
,
1645
,
1646
,
/* 940 */
499
,
119
,
520
,
78
,
1019
,
1710
,
117
,
1658
,
1659
,
293
,
/* 950 */
17
06
,
139
,
244
,
1514
,
501
,
50
,
1740
,
478
,
49
,
21
5
,
/* 960 */
1047
,
961
,
1051
,
213
,
500
,
218
,
220
,
1058
,
1613
,
460
,
/* 970 */
17
37
,
1168
,
1642
,
1167
,
57
,
56
,
345
,
3
,
962
,
152
,
/* 980 */
117
8
,
1056
,
318
,
322
,
339
,
1670
,
120
,
278
,
262
,
1643
,
/* 990 */
50
3
,
1645
,
1646
,
499
,
988
,
520
,
268
,
279
,
359
,
329
,
/* 1000 */
16
58
,
325
,
321
,
149
,
240
,
1125
,
1554
,
480
,
552
,
154
,
/* 1010 */
36
6
,
374
,
379
,
1184
,
380
,
373
,
388
,
500
,
375
,
1187
,
/* 1020 */
3
91
,
1613
,
161
,
392
,
1186
,
163
,
473
,
551
,
550
,
393
,
/* 1030 */
5
49
,
548
,
547
,
165
,
147
,
394
,
1185
,
168
,
1670
,
1345
,
/* 1040 */
39
5
,
80
,
1643
,
503
,
1645
,
1646
,
499
,
1642
,
520
,
60
,
/* 1050 */
489
,
1710
,
398
,
417
,
171
,
293
,
1706
,
139
,
419
,
1464
,
/* 1060 */
94
,
17
5
,
146
0
,
93
,
92
,
91
,
90
,
89
,
88
,
87
,
/* 1070 */
86
,
85
,
177
,
84
,
1162
,
1658
,
1738
,
122
,
123
,
287
,
/* 1080 */
164
2
,
188
,
501
,
1462
,
241
,
1458
,
124
,
1597
,
125
,
448
,
/* 1090 */
1
183
,
191
,
500
,
452
,
193
,
449
,
1613
,
457
,
196
,
466
,
/* 1100 */
17
51
,
1750
,
507
,
6
,
1731
,
206
,
474
,
242
,
1658
,
462
,
/* 1110 */
4
63
,
458
,
5
,
1670
,
135
,
501
,
80
,
1643
,
503
,
1645
,
/* 1120 */
16
46
,
499
,
292
,
520
,
199
,
500
,
1710
,
208
,
202
,
1613
,
/* 1130 */
29
3
,
1706
,
1785
,
111
,
1276
,
469
,
1182
,
1741
,
40
,
49
0
,
/* 1140 */
487
,
1744
,
1642
,
1725
,
1788
,
18
,
1670
,
294
,
51
0
,
80
,
/* 1150 */
164
3
,
503
,
1645
,
1646
,
499
,
1563
,
520
,
505
,
506
,
1710
,
/* 1160 */
1562
,
511
,
512
,
293
,
1706
,
1785
,
228
,
302
,
209
,
230
,
/* 1170 */
16
58
,
243
,
68
,
1475
,
1767
,
70
,
523
,
501
,
1691
,
1447
,
/* 1180 */
246
,
237
,
598
,
47
,
134
,
252
,
289
,
500
,
259
,
248
,
/* 1190 */
1768
,
1613
,
253
,
214
,
1607
,
250
,
1642
,
1606
,
484
,
217
,
/* 1200 */
317
,
1603
,
319
,
320
,
219
,
1642
,
491
,
1150
,
1670
,
1151
,
/* 1210 */
150
,
80
,
1643
,
503
,
1645
,
1646
,
499
,
324
,
520
,
1601
,
/* 1220 */
326
,
1710
,
327
,
328
,
1658
,
293
,
1706
,
1785
,
1600
,
330
,
/* 1230 */
1599
,
501
,
332
,
1658
,
1598
,
334
,
1728
,
1583
,
151
,
337
,
/* 1240 */
50
1
,
500
,
338
,
1128
,
1127
,
1613
,
343
,
344
,
1575
,
1574
,
/* 1250 */
50
0
,
1577
,
1576
,
1095
,
1613
,
1547
,
1546
,
1545
,
1544
,
1642
,
/* 1260 */
48
1
,
1543
,
1670
,
1542
,
1541
,
132
,
1643
,
503
,
1645
,
1646
,
/* 1270 */
499
,
1670
,
520
,
1540
,
258
,
1643
,
503
,
1645
,
1646
,
499
,
/* 1280 */
15
39
,
520
,
1538
,
1537
,
1536
,
1535
,
1534
,
1658
,
1533
,
1532
,
/* 1290 */
153
1
,
1530
,
1529
,
115
,
501
,
1528
,
1527
,
1526
,
1525
,
1642
,
/* 1300 */
177
2
,
1524
,
1523
,
1097
,
500
,
1522
,
1521
,
1520
,
1613
,
159
,
/* 1310 */
17
87
,
1405
,
1373
,
144
,
106
,
136
,
384
,
1769
,
1642
,
386
,
/* 1320 */
137
2
,
1591
,
927
,
1585
,
926
,
1670
,
1569
,
1658
,
81
,
1643
,
/* 1330 */
50
3
,
1645
,
1646
,
499
,
501
,
520
,
1560
,
160
,
1710
,
400
,
/* 1340 */
107
,
167
,
1709
,
1706
,
500
,
1453
,
1658
,
1404
,
1613
,
1402
,
/* 1350 */
14
00
,
401
,
955
,
498
,
405
,
1398
,
1396
,
1385
,
1384
,
409
,
/* 1360 */
399
,
404
,
403
,
500
,
413
,
1670
,
407
,
1613
,
81
,
1643
,
/* 1370 */
50
3
,
1645
,
1646
,
499
,
1642
,
520
,
408
,
411
,
1710
,
412
,
/* 1380 */
1371
,
1455
,
492
,
1706
,
1670
,
1062
,
1454
,
266
,
1643
,
503
,
/* 1390 */
164
5
,
1646
,
499
,
497
,
520
,
494
,
1682
,
1061
,
987
,
986
,
/* 1400 */
985
,
984
,
1658
,
602
,
566
,
1394
,
568
,
83
,
981
,
501
,
/* 1410 */
284
,
174
,
1389
,
980
,
979
,
285
,
436
,
239
,
1387
,
500
,
/* 1420 */
286
,
439
,
1370
,
1613
,
441
,
1369
,
443
,
82
,
1590
,
105
,
/* 1430 */
1
135
,
1584
,
48
,
1642
,
1568
,
591
,
587
,
583
,
579
,
238
,
/* 1440 */
167
0
,
450
,
192
,
81
,
1643
,
503
,
1645
,
1646
,
499
,
1567
,
/* 1450 */
52
0
,
1559
,
64
,
1710
,
195
,
4
,
37
,
15
,
1707
,
200
,
/* 1460 */
1301
,
1658
,
43
,
77
,
205
,
133
,
233
,
204
,
501
,
197
,
/* 1470 */
22
,
1633
,
1294
,
451
,
65
,
10
,
23
,
16
,
500
,
42
,
/* 1480 */
1273
,
1272
,
1613
,
211
,
41
,
297
,
126
,
1642
,
143
,
1330
,
/* 1490 */
1319
,
307
,
306
,
17
,
1325
,
1324
,
19
,
295
,
148
,
1670
,
/* 1500 */
51
3
,
1170
,
267
,
1643
,
503
,
1645
,
1646
,
499
,
1329
,
520
,
/* 1510 */
1328
,
296
,
29
,
1236
,
1215
,
1658
,
222
,
1642
,
1214
,
1201
,
/* 1520 */
12
,
20
,
498
,
502
,
223
,
459
,
1163
,
1299
,
194
,
1558
,
/* 1530 */
229
,
1632
,
500
,
21
,
234
,
508
,
1613
,
225
,
227
,
66
,
/* 1540 */
67
,
231
,
1673
,
1162
,
13
,
1658
,
1133
,
1217
,
189
,
519
,
/* 1550 */
164
2
,
44
,
501
,
1670
,
1172
,
71
,
266
,
1643
,
503
,
1645
,
/* 1560 */
16
46
,
499
,
500
,
520
,
524
,
1683
,
1613
,
522
,
309
,
299
,
/* 1570 */
1
048
,
526
,
528
,
1045
,
529
,
531
,
1042
,
1036
,
1658
,
532
,
/* 1580 */
164
2
,
521
,
534
,
1670
,
535
,
501
,
267
,
1643
,
503
,
1645
,
/* 1590 */
16
46
,
499
,
1166
,
520
,
1034
,
500
,
537
,
1025
,
538
,
1613
,
/* 1600 */
544
,
1057
,
301
,
72
,
1040
,
1054
,
1039
,
1038
,
1658
,
1037
,
/* 1610 */
164
2
,
73
,
477
,
74
,
1053
,
501
,
1670
,
994
,
953
,
267
,
/* 1620 */
164
3
,
503
,
1645
,
1646
,
499
,
500
,
520
,
1055
,
553
,
1613
,
/* 1630 */
555
,
236
,
975
,
974
,
973
,
1171
,
972
,
970
,
1658
,
1401
,
/* 1640 */
112
,
97
1
,
969
,
968
,
991
,
501
,
1670
,
989
,
965
,
254
,
/* 1650 */
164
3
,
503
,
1645
,
1646
,
499
,
500
,
520
,
1174
,
964
,
1613
,
/* 1660 */
48
1
,
1642
,
578
,
963
,
960
,
959
,
958
,
576
,
518
,
1220
,
/* 1670 */
122
1
,
1399
,
577
,
582
,
581
,
580
,
1670
,
1642
,
110
,
261
,
/* 1680 */
164
3
,
503
,
1645
,
1646
,
499
,
1397
,
520
,
584
,
585
,
1658
,
/* 1690 */
58
6
,
1395
,
588
,
210
,
1717
,
476
,
501
,
475
,
590
,
589
,
/* 1700 */
177
2
,
1383
,
592
,
593
,
1382
,
1658
,
500
,
1368
,
596
,
597
,
/* 1710 */
161
3
,
1158
,
501
,
144
,
247
,
600
,
601
,
1769
,
1343
,
1343
,
/* 1720 */
1
343
,
1343
,
500
,
1343
,
1642
,
1343
,
1613
,
1670
,
1343
,
1343
,
/* 1730 */
26
3
,
1643
,
503
,
1645
,
1646
,
499
,
1343
,
520
,
1343
,
1343
,
/* 1740 */
134
3
,
1343
,
1642
,
1670
,
1343
,
1343
,
255
,
1643
,
503
,
1645
,
/* 1750 */
16
46
,
499
,
1658
,
520
,
1343
,
1343
,
1343
,
1642
,
1343
,
501
,
/* 1760 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
500
,
/* 1770 */
16
58
,
1343
,
1343
,
1613
,
1343
,
1343
,
1343
,
501
,
1343
,
1343
,
/* 1780 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1658
,
1343
,
500
,
1343
,
1343
,
/* 1790 */
167
0
,
1613
,
501
,
264
,
1643
,
503
,
1645
,
1646
,
499
,
1343
,
/* 1800 */
52
0
,
1343
,
500
,
1343
,
1642
,
1343
,
1613
,
1343
,
1670
,
1343
,
/* 1810 */
134
3
,
256
,
1643
,
503
,
1645
,
1646
,
499
,
1343
,
520
,
1343
,
/* 1820 */
164
2
,
1343
,
1343
,
1670
,
1343
,
1343
,
265
,
1643
,
503
,
1645
,
/* 1830 */
16
46
,
499
,
1658
,
520
,
1343
,
1343
,
1343
,
1343
,
1343
,
501
,
/* 1840 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1658
,
500
,
/* 1850 */
134
3
,
1343
,
1343
,
1613
,
1343
,
501
,
1343
,
1343
,
1343
,
1343
,
/* 1860 */
134
3
,
1343
,
1343
,
1343
,
1343
,
500
,
1343
,
1642
,
1343
,
1613
,
/* 1870 */
167
0
,
1343
,
1343
,
257
,
1643
,
503
,
1645
,
1646
,
499
,
1343
,
/* 1880 */
52
0
,
1343
,
1343
,
1343
,
1343
,
1343
,
1670
,
1343
,
1343
,
1654
,
/* 1890 */
164
3
,
503
,
1645
,
1646
,
499
,
1658
,
520
,
1642
,
1343
,
1343
,
/* 1900 */
134
3
,
1343
,
501
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
/* 1910 */
134
3
,
1343
,
500
,
1343
,
1343
,
1343
,
1613
,
1343
,
1343
,
1343
,
/* 1920 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1658
,
1343
,
1343
,
1343
,
1343
,
/* 1930 */
134
3
,
1343
,
501
,
1670
,
1343
,
1343
,
1653
,
1643
,
503
,
1645
,
/* 1940 */
16
46
,
499
,
500
,
520
,
1343
,
1343
,
1613
,
1642
,
1343
,
1343
,
/* 1950 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
/* 1960 */
134
3
,
1343
,
1343
,
1670
,
1343
,
1343
,
1652
,
1643
,
503
,
1645
,
/* 1970 */
16
46
,
499
,
1343
,
520
,
1343
,
1658
,
1343
,
1642
,
1343
,
1343
,
/* 1980 */
134
3
,
1343
,
501
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
/* 1990 */
134
3
,
1343
,
500
,
1343
,
1343
,
1343
,
1613
,
1343
,
1343
,
1343
,
/* 2000 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1658
,
1343
,
1343
,
1343
,
1343
,
/* 2010 */
134
3
,
1343
,
501
,
1670
,
1343
,
1343
,
276
,
1643
,
503
,
1645
,
/* 2020 */
16
46
,
499
,
500
,
520
,
1343
,
1343
,
1613
,
1642
,
1343
,
1343
,
/* 2030 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1343
,
1642
,
1343
,
1343
,
1343
,
/* 2040 */
134
3
,
1343
,
1343
,
1670
,
1343
,
1343
,
275
,
1643
,
503
,
1645
,
/* 2050 */
16
46
,
499
,
1343
,
520
,
1343
,
1658
,
1343
,
1343
,
1343
,
1343
,
/* 2060 */
134
3
,
1343
,
501
,
1343
,
1658
,
1343
,
1343
,
1343
,
1343
,
1343
,
/* 2070 */
134
3
,
501
,
500
,
1343
,
1343
,
1343
,
1613
,
1343
,
1343
,
1343
,
/* 2080 */
134
3
,
500
,
1343
,
1343
,
1343
,
1613
,
1343
,
1343
,
1343
,
1343
,
/* 2090 */
164
2
,
1343
,
1343
,
1670
,
1343
,
1343
,
277
,
1643
,
503
,
1645
,
/* 2100 */
16
46
,
499
,
1670
,
520
,
1343
,
274
,
1643
,
503
,
1645
,
1646
,
/* 2110 */
499
,
1343
,
520
,
1343
,
1343
,
1343
,
1343
,
1343
,
1658
,
1343
,
/* 2120 */
134
3
,
1343
,
1343
,
1343
,
1343
,
501
,
1343
,
1343
,
1343
,
1343
,
/* 2130 */
134
3
,
1343
,
1343
,
1343
,
1343
,
500
,
1343
,
1343
,
1343
,
1613
,
/* 2140 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
1343
,
/* 2150 */
134
3
,
1343
,
1343
,
1343
,
1343
,
1343
,
1670
,
1343
,
1343
,
260
,
/* 2160 */
164
3
,
503
,
1645
,
1646
,
499
,
1343
,
520
,
/* 0 */
38
3
,
76
,
384
,
1380
,
391
,
519
,
384
,
1380
,
1631
,
28
,
/* 10 */
22
3
,
1467
,
35
,
33
,
113
,
1463
,
343
,
347
,
1646
,
1777
,
/* 20 */
30
1
,
1470
,
1159
,
1627
,
1635
,
1633
,
36
,
34
,
32
,
31
,
/* 30 */
30
,
172
9
,
1776
,
1478
,
94
,
522
,
1774
,
93
,
92
,
91
,
/* 40 */
90
,
89
,
88
,
87
,
86
,
85
,
16
62
,
1157
,
1523
,
292
,
/* 50 */
32
,
31
,
30
,
50
3
,
291
,
1726
,
1777
,
479
,
14
,
1521
,
/* 60 */
35
,
33
,
128
5
,
502
,
1165
,
518
,
1631
,
1617
,
301
,
145
,
/* 70 */
115
9
,
349
,
274
,
1774
,
398
,
36
,
34
,
32
,
31
,
30
,
/* 80 */
1
,
162
7
,
1634
,
1633
,
1675
,
112
,
24
,
132
,
1647
,
505
,
/* 90 */
164
9
,
1650
,
501
,
522
,
522
,
1157
,
36
,
34
,
32
,
31
,
/* 100 */
30
,
61
,
601
,
1247
,
271
,
483
,
14
,
519
,
35
,
33
,
/* 110 */
59
7
,
596
,
1165
,
1158
,
108
,
518
,
301
,
305
,
1159
,
104
,
/* 120 */
11
81
,
274
,
1473
,
110
,
939
,
128
,
419
,
130
,
2
,
1360
,
/* 130 */
54
,
48
4
,
1791
,
1480
,
1777
,
1478
,
519
,
69
,
212
,
1722
,
/* 140 */
47
8
,
1348
,
477
,
1157
,
1196
,
1777
,
1777
,
146
,
104
,
417
,
/* 150 */
601
,
1774
,
1247
,
1248
,
14
,
424
,
1160
,
1471
,
147
,
1775
,
/* 160 */
116
5
,
1158
,
1774
,
1774
,
1478
,
103
,
102
,
101
,
100
,
99
,
/* 170 */
98
,
97
,
96
,
95
,
12
53
,
38
,
2
,
554
,
1163
,
1164
,
/* 180 */
54
,
120
9
,
1210
,
1212
,
1213
,
1214
,
1215
,
1216
,
498
,
520
,
/* 190 */
122
4
,
1225
,
1226
,
1227
,
1228
,
1229
,
553
,
552
,
601
,
551
,
/* 200 */
5
50
,
549
,
1248
,
495
,
1160
,
342
,
1309
,
341
,
148
,
1158
,
/* 210 */
27
,
29
9
,
1242
,
1243
,
1244
,
1245
,
1246
,
1250
,
1251
,
1252
,
/* 220 */
131
,
118
3
,
506
,
1253
,
1435
,
304
,
1163
,
1164
,
1568
,
1209
,
/* 230 */
12
10
,
1212
,
1213
,
1214
,
1215
,
1216
,
498
,
520
,
1224
,
1225
,
/* 240 */
122
6
,
1227
,
1228
,
1229
,
1407
,
465
,
1307
,
1308
,
1310
,
1311
,
/* 250 */
55
,
54
,
11
60
,
36
,
34
,
32
,
31
,
30
,
148
,
27
,
/* 260 */
29
9
,
1242
,
1243
,
1244
,
1245
,
1246
,
1250
,
1251
,
1252
,
63
,
/* 270 */
28
9
,
479
,
1284
,
188
,
1163
,
1164
,
1346
,
1209
,
1210
,
1212
,
/* 280 */
12
13
,
1214
,
1215
,
1216
,
498
,
520
,
1224
,
1225
,
1226
,
1227
,
/* 290 */
122
8
,
1229
,
35
,
33
,
36
,
34
,
32
,
31
,
30
,
112
,
/* 300 */
30
1
,
1456
,
1159
,
148
,
577
,
576
,
575
,
316
,
148
,
574
,
/* 310 */
57
3
,
572
,
114
,
567
,
566
,
565
,
564
,
563
,
562
,
561
,
/* 320 */
5
60
,
121
,
1299
,
1239
,
1523
,
313
,
54
,
1157
,
991
,
1662
,
/* 330 */
30
6
,
1646
,
1559
,
1561
,
317
,
1521
,
472
,
110
,
140
,
311
,
/* 340 */
35
,
33
,
12
30
,
473
,
1165
,
993
,
923
,
128
,
301
,
1517
,
/* 350 */
115
9
,
481
,
142
,
1722
,
1723
,
1480
,
1727
,
26
,
398
,
1662
,
/* 360 */
8
,
36
,
34
,
32
,
31
,
30
,
50
3
,
36
,
34
,
32
,
/* 370 */
31
,
30
,
47
1
,
468
,
1777
,
1157
,
502
,
1410
,
314
,
148
,
/* 380 */
161
7
,
556
,
601
,
462
,
927
,
928
,
128
,
145
,
35
,
33
,
/* 390 */
33
4
,
1774
,
1165
,
1158
,
1480
,
518
,
301
,
1675
,
1159
,
53
,
/* 400 */
26
8
,
1647
,
505
,
1649
,
1650
,
501
,
382
,
522
,
9
,
386
,
/* 410 */
33
6
,
332
,
1029
,
545
,
544
,
543
,
1033
,
542
,
1035
,
1036
,
/* 420 */
5
41
,
1038
,
538
,
1157
,
1044
,
535
,
1046
,
1047
,
532
,
529
,
/* 430 */
601
,
36
,
34
,
32
,
31
,
30
,
1160
,
433
,
432
,
54
8
,
/* 440 */
116
5
,
1158
,
431
,
474
,
469
,
109
,
428
,
1454
,
519
,
427
,
/* 450 */
42
6
,
425
,
1185
,
1469
,
148
,
39
,
9
,
1729
,
1163
,
1164
,
/* 460 */
34
8
,
1209
,
1210
,
1212
,
1213
,
1214
,
1215
,
1216
,
498
,
520
,
/* 470 */
122
4
,
1225
,
1226
,
1227
,
1228
,
1229
,
1478
,
1283
,
601
,
1292
,
/* 480 */
1235
,
1725
,
433
,
432
,
1160
,
1183
,
1183
,
431
,
148
,
1158
,
/* 490 */
109
,
42
8
,
1523
,
447
,
427
,
426
,
425
,
1341
,
312
,
1637
,
/* 500 */
119
6
,
1159
,
1617
,
1521
,
556
,
455
,
1163
,
1164
,
309
,
1209
,
/* 510 */
12
10
,
1212
,
1213
,
1214
,
1215
,
1216
,
498
,
520
,
1224
,
1225
,
/* 520 */
122
6
,
1227
,
1228
,
1229
,
154
,
1631
,
1157
,
36
,
34
,
32
,
/* 530 */
31
,
30
,
11
60
,
1777
,
390
,
1639
,
1523
,
386
,
388
,
1371
,
/* 540 */
162
7
,
1634
,
1633
,
1165
,
1181
,
373
,
145
,
1522
,
59
,
1370
,
/* 550 */
17
74
,
58
,
522
,
456
,
1163
,
1164
,
1646
,
1209
,
1210
,
1212
,
/* 560 */
12
13
,
1214
,
1215
,
1216
,
498
,
520
,
1224
,
1225
,
1226
,
1227
,
/* 570 */
122
8
,
1229
,
35
,
33
,
270
,
519
,
1181
,
214
,
1340
,
61
,
/* 580 */
30
1
,
601
,
1159
,
366
,
1662
,
519
,
378
,
358
,
1617
,
158
,
/* 590 */
157
,
503
,
1158
,
1777
,
128
,
1369
,
174
,
516
,
1617
,
1729
,
/* 600 */
147
4
,
502
,
1481
,
1478
,
379
,
1617
,
145
,
1157
,
139
,
519
,
/* 610 */
17
74
,
483
,
1368
,
1478
,
415
,
411
,
407
,
403
,
173
,
283
,
/* 620 */
485
,
359
,
1675
,
1724
,
1165
,
259
,
1647
,
505
,
1649
,
1650
,
/* 630 */
501
,
519
,
522
,
1120
,
940
,
1160
,
939
,
1478
,
479
,
445
,
/* 640 */
2
,
11
22
,
62
,
397
,
1617
,
171
,
1367
,
1211
,
1211
,
11
,
/* 650 */
10
,
1777
,
443
,
1366
,
430
,
429
,
7
,
1163
,
1164
,
1478
,
/* 660 */
127
,
161
7
,
601
,
941
,
147
,
1365
,
112
,
284
,
1774
,
282
,
/* 670 */
28
1
,
1184
,
421
,
1158
,
377
,
1364
,
423
,
372
,
371
,
370
,
/* 680 */
36
9
,
368
,
365
,
364
,
363
,
362
,
361
,
357
,
356
,
355
,
/* 690 */
35
4
,
353
,
352
,
351
,
350
,
1617
,
1183
,
519
,
519
,
422
,
/* 700 */
51
9
,
1121
,
1617
,
170
,
110
,
165
,
1455
,
167
,
479
,
1475
,
/* 710 */
159
7
,
1186
,
517
,
1249
,
1617
,
1363
,
1160
,
1362
,
1359
,
143
,
/* 720 */
17
22
,
1723
,
487
,
1727
,
1617
,
1478
,
1478
,
163
,
1478
,
126
1
,
/* 730 */
164
6
,
1358
,
1357
,
1356
,
1254
,
490
,
112
,
1355
,
1163
,
1164
,
/* 740 */
1182
,
1209
,
1210
,
1212
,
1213
,
1214
,
1215
,
1216
,
498
,
520
,
/* 750 */
122
4
,
1225
,
1226
,
1227
,
1228
,
1229
,
519
,
246
,
1662
,
519
,
/* 760 */
1
508
,
1354
,
1353
,
1352
,
1617
,
503
,
1617
,
1617
,
236
,
1556
,
/* 770 */
25
,
31
5
,
571
,
569
,
110
,
502
,
156
,
927
,
928
,
1617
,
/* 780 */
161
7
,
1617
,
1617
,
1351
,
1478
,
483
,
1617
,
1478
,
506
,
144
,
/* 790 */
17
22
,
1723
,
1606
,
1727
,
1569
,
559
,
1675
,
1450
,
554
,
79
,
/* 800 */
164
7
,
505
,
1649
,
1650
,
501
,
1646
,
522
,
423
,
570
,
1715
,
/* 810 */
161
7
,
1617
,
1617
,
273
,
1711
,
1560
,
1561
,
553
,
552
,
1397
,
/* 820 */
5
51
,
550
,
549
,
1734
,
1280
,
1777
,
1280
,
558
,
179
,
1392
,
/* 830 */
422
,
177
,
1617
,
1662
,
1144
,
1145
,
199
,
324
,
147
,
1465
,
/* 840 */
50
3
,
434
,
1774
,
181
,
129
,
1390
,
180
,
1461
,
337
,
252
,
/* 850 */
50
2
,
436
,
183
,
185
,
1617
,
182
,
184
,
118
,
1211
,
45
,
/* 860 */
48
3
,
250
,
52
,
46
,
272
,
51
,
1646
,
439
,
202
,
11
,
/* 870 */
10
,
1675
,
1343
,
1344
,
79
,
1647
,
505
,
1649
,
1650
,
501
,
/* 880 */
43
8
,
522
,
159
,
37
,
1715
,
37
,
191
,
37
,
273
,
1711
,
/* 890 */
225
,
497
,
75
,
116
,
1662
,
446
,
547
,
457
,
454
,
1306
,
/* 900 */
177
7
,
482
,
71
,
1361
,
117
,
1168
,
54
,
488
,
204
,
187
,
/* 910 */
1
436
,
502
,
118
,
145
,
1167
,
1617
,
1453
,
1774
,
218
,
1646
,
/* 920 */
45
,
441
,
491
,
1255
,
209
,
1217
,
435
,
1115
,
466
,
1663
,
/* 930 */
227
,
186
,
1675
,
511
,
448
,
80
,
1647
,
505
,
1649
,
1650
,
/* 940 */
501
,
527
,
522
,
78
,
233
,
1715
,
117
,
1662
,
1381
,
294
,
/* 950 */
17
11
,
141
,
1022
,
416
,
503
,
50
,
1518
,
480
,
49
,
174
5
,
/* 960 */
245
,
217
,
220
,
215
,
502
,
118
,
3
,
1181
,
1617
,
461
,
/* 970 */
17
42
,
1171
,
1646
,
119
,
57
,
56
,
346
,
222
,
117
,
153
,
/* 980 */
117
0
,
1050
,
319
,
323
,
340
,
1675
,
1054
,
964
,
263
,
1647
,
/* 990 */
50
5
,
1649
,
1650
,
501
,
279
,
522
,
269
,
991
,
280
,
330
,
/* 1000 */
16
62
,
326
,
322
,
150
,
965
,
1061
,
241
,
482
,
554
,
1128
,
/* 1010 */
36
0
,
155
,
1558
,
1059
,
367
,
374
,
375
,
502
,
120
,
376
,
/* 1020 */
3
80
,
1617
,
1187
,
381
,
389
,
1190
,
475
,
553
,
552
,
392
,
/* 1030 */
5
51
,
550
,
549
,
393
,
148
,
162
,
164
,
1189
,
1675
,
1349
,
/* 1040 */
39
4
,
80
,
1647
,
505
,
1649
,
1650
,
501
,
1646
,
522
,
166
,
/* 1050 */
395
,
1715
,
1188
,
396
,
169
,
294
,
1711
,
141
,
60
,
399
,
/* 1060 */
94
,
17
2
,
42
0
,
93
,
92
,
91
,
90
,
89
,
88
,
87
,
/* 1070 */
86
,
85
,
1468
,
418
,
288
,
1662
,
1743
,
1165
,
176
,
1464
,
/* 1080 */
164
6
,
84
,
503
,
178
,
122
,
1601
,
123
,
242
,
189
,
1466
,
/* 1090 */
1
462
,
124
,
502
,
125
,
449
,
1186
,
1617
,
450
,
192
,
453
,
/* 1100 */
17
46
,
243
,
194
,
467
,
458
,
197
,
1756
,
509
,
1662
,
6
,
/* 1110 */
4
59
,
1755
,
476
,
1675
,
1736
,
503
,
80
,
1647
,
505
,
1649
,
/* 1120 */
16
50
,
501
,
464
,
522
,
293
,
502
,
1715
,
200
,
470
,
1617
,
/* 1130 */
29
4
,
1711
,
1790
,
463
,
203
,
5
,
208
,
1280
,
135
,
21
0
,
/* 1140 */
111
,
1749
,
1646
,
1185
,
40
,
492
,
1675
,
295
,
173
0
,
80
,
/* 1150 */
164
7
,
505
,
1649
,
1650
,
501
,
216
,
522
,
1567
,
489
,
1715
,
/* 1160 */
18
,
1566
,
211
,
294
,
1711
,
1790
,
512
,
229
,
507
,
244
,
/* 1170 */
16
62
,
508
,
303
,
513
,
1772
,
514
,
70
,
503
,
231
,
1696
,
/* 1180 */
68
,
525
,
1793
,
1479
,
247
,
1451
,
238
,
502
,
600
,
1611
,
/* 1190 */
290
,
1617
,
47
,
1773
,
249
,
134
,
1646
,
253
,
251
,
1610
,
/* 1200 */
486
,
219
,
260
,
318
,
221
,
1646
,
254
,
1607
,
1675
,
493
,
/* 1210 */
320
,
80
,
1647
,
505
,
1649
,
1650
,
501
,
321
,
522
,
1153
,
/* 1220 */
1154
,
1715
,
151
,
325
,
1662
,
294
,
1711
,
1790
,
1605
,
327
,
/* 1230 */
328
,
503
,
1604
,
1662
,
329
,
331
,
1733
,
1603
,
333
,
1602
,
/* 1240 */
50
3
,
502
,
335
,
1587
,
152
,
1617
,
338
,
339
,
1131
,
1130
,
/* 1250 */
50
2
,
1581
,
1580
,
344
,
1617
,
1579
,
345
,
1578
,
1098
,
1646
,
/* 1260 */
48
3
,
1551
,
1675
,
1550
,
1549
,
132
,
1647
,
505
,
1649
,
1650
,
/* 1270 */
501
,
1675
,
522
,
1548
,
259
,
1647
,
505
,
1649
,
1650
,
501
,
/* 1280 */
15
47
,
522
,
1546
,
1545
,
1544
,
1543
,
1542
,
1662
,
1541
,
1540
,
/* 1290 */
153
9
,
1538
,
1537
,
1536
,
503
,
1535
,
1534
,
1533
,
115
,
1646
,
/* 1300 */
177
7
,
1532
,
1531
,
1530
,
502
,
1529
,
1528
,
1527
,
1617
,
1100
,
/* 1310 */
17
92
,
1526
,
1525
,
145
,
1524
,
1409
,
1377
,
1774
,
1646
,
160
,
/* 1320 */
137
6
,
385
,
138
,
401
,
930
,
1675
,
1595
,
1662
,
81
,
1647
,
/* 1330 */
50
5
,
1649
,
1650
,
501
,
503
,
522
,
106
,
929
,
1715
,
405
,
/* 1340 */
1402
,
107
,
1714
,
1711
,
502
,
1589
,
1662
,
1573
,
1617
,
1564
,
/* 1350 */
14
57
,
161
,
387
,
500
,
168
,
1408
,
1406
,
958
,
402
,
1404
,
/* 1360 */
1400
,
406
,
410
,
502
,
414
,
1675
,
400
,
1617
,
81
,
1647
,
/* 1370 */
50
5
,
1649
,
1650
,
501
,
1646
,
522
,
404
,
408
,
1715
,
409
,
/* 1380 */
412
,
413
,
494
,
1711
,
1675
,
1389
,
1388
,
267
,
1647
,
505
,
/* 1390 */
164
9
,
1650
,
501
,
499
,
522
,
496
,
1687
,
1375
,
1459
,
1065
,
/* 1400 */
1064
,
1458
,
1662
,
604
,
990
,
989
,
568
,
83
,
988
,
503
,
/* 1410 */
987
,
570
,
1398
,
984
,
983
,
175
,
285
,
240
,
982
,
502
,
/* 1420 */
437
,
286
,
1391
,
1617
,
1393
,
287
,
440
,
1374
,
442
,
105
,
/* 1430 */
1
373
,
444
,
1594
,
1646
,
82
,
593
,
589
,
585
,
581
,
239
,
/* 1440 */
167
5
,
1588
,
1138
,
81
,
1647
,
505
,
1649
,
1650
,
501
,
1572
,
/* 1450 */
52
2
,
451
,
1571
,
1715
,
1563
,
64
,
196
,
4
,
1712
,
37
,
/* 1460 */
15
,
1662
,
201
,
77
,
43
,
207
,
234
,
48
,
503
,
1305
,
/* 1470 */
133
,
205
,
22
,
41
,
1298
,
206
,
452
,
193
,
502
,
1637
,
/* 1480 */
65
,
198
,
1617
,
23
,
16
,
298
,
1277
,
1646
,
1276
,
213
,
/* 1490 */
136
,
308
,
307
,
126
,
42
,
1329
,
1334
,
17
,
1323
,
1675
,
/* 1500 */
51
5
,
1173
,
268
,
1647
,
505
,
1649
,
1650
,
501
,
1328
,
522
,
/* 1510 */
296
,
1333
,
13
,
1332
,
297
,
1662
,
10
,
1646
,
19
,
1219
,
/* 1520 */
1240
,
1218
,
500
,
29
,
137
,
460
,
1166
,
12
,
195
,
149
,
/* 1530 */
20
,
1204
,
502
,
504
,
1562
,
21
,
1617
,
230
,
224
,
1303
,
/* 1540 */
226
,
71
,
228
,
1165
,
1175
,
1662
,
1136
,
510
,
190
,
66
,
/* 1550 */
164
6
,
232
,
503
,
1675
,
67
,
1636
,
267
,
1647
,
505
,
1649
,
/* 1560 */
16
50
,
501
,
502
,
522
,
235
,
1688
,
1617
,
1678
,
521
,
300
,
/* 1570 */
1
221
,
44
,
524
,
1051
,
526
,
310
,
528
,
530
,
1662
,
1048
,
/* 1580 */
164
6
,
523
,
531
,
1675
,
1045
,
503
,
268
,
1647
,
505
,
1649
,
/* 1590 */
16
50
,
501
,
1169
,
522
,
533
,
502
,
1039
,
534
,
536
,
1617
,
/* 1600 */
1037
,
537
,
302
,
539
,
540
,
1028
,
1060
,
1058
,
1662
,
1043
,
/* 1610 */
164
6
,
1042
,
479
,
72
,
1041
,
503
,
1675
,
1040
,
546
,
268
,
/* 1620 */
164
7
,
505
,
1649
,
1650
,
501
,
502
,
522
,
1057
,
73
,
1617
,
/* 1630 */
74
,
1056
,
956
,
555
,
997
,
1174
,
557
,
237
,
1662
,
978
,
/* 1640 */
112
,
97
7
,
976
,
973
,
975
,
503
,
1675
,
974
,
972
,
255
,
/* 1650 */
164
7
,
505
,
1649
,
1650
,
501
,
502
,
522
,
1177
,
971
,
1617
,
/* 1660 */
48
3
,
1646
,
994
,
992
,
968
,
967
,
966
,
963
,
520
,
1224
,
/* 1670 */
122
5
,
962
,
961
,
1405
,
578
,
579
,
1675
,
1646
,
110
,
262
,
/* 1680 */
164
7
,
505
,
1649
,
1650
,
501
,
580
,
522
,
1403
,
582
,
1662
,
/* 1690 */
58
3
,
584
,
1401
,
212
,
1722
,
478
,
503
,
477
,
586
,
588
,
/* 1700 */
177
7
,
1399
,
587
,
591
,
592
,
1662
,
502
,
590
,
1387
,
595
,
/* 1710 */
161
7
,
594
,
503
,
145
,
1386
,
1372
,
598
,
1774
,
599
,
1347
,
/* 1720 */
1
161
,
248
,
502
,
602
,
1646
,
603
,
1617
,
1675
,
1347
,
1347
,
/* 1730 */
26
4
,
1647
,
505
,
1649
,
1650
,
501
,
1347
,
522
,
1347
,
1347
,
/* 1740 */
134
7
,
1347
,
1646
,
1675
,
1347
,
1347
,
256
,
1647
,
505
,
1649
,
/* 1750 */
16
50
,
501
,
1662
,
522
,
1347
,
1347
,
1347
,
1646
,
1347
,
503
,
/* 1760 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
502
,
/* 1770 */
16
62
,
1347
,
1347
,
1617
,
1347
,
1347
,
1347
,
503
,
1347
,
1347
,
/* 1780 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1662
,
1347
,
502
,
1347
,
1347
,
/* 1790 */
167
5
,
1617
,
503
,
265
,
1647
,
505
,
1649
,
1650
,
501
,
1347
,
/* 1800 */
52
2
,
1347
,
502
,
1347
,
1646
,
1347
,
1617
,
1347
,
1675
,
1347
,
/* 1810 */
134
7
,
257
,
1647
,
505
,
1649
,
1650
,
501
,
1347
,
522
,
1347
,
/* 1820 */
164
6
,
1347
,
1347
,
1675
,
1347
,
1347
,
266
,
1647
,
505
,
1649
,
/* 1830 */
16
50
,
501
,
1662
,
522
,
1347
,
1347
,
1347
,
1347
,
1347
,
503
,
/* 1840 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1662
,
502
,
/* 1850 */
134
7
,
1347
,
1347
,
1617
,
1347
,
503
,
1347
,
1347
,
1347
,
1347
,
/* 1860 */
134
7
,
1347
,
1347
,
1347
,
1347
,
502
,
1347
,
1646
,
1347
,
1617
,
/* 1870 */
167
5
,
1347
,
1347
,
258
,
1647
,
505
,
1649
,
1650
,
501
,
1347
,
/* 1880 */
52
2
,
1347
,
1347
,
1347
,
1347
,
1347
,
1675
,
1347
,
1347
,
1658
,
/* 1890 */
164
7
,
505
,
1649
,
1650
,
501
,
1662
,
522
,
1646
,
1347
,
1347
,
/* 1900 */
134
7
,
1347
,
503
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
/* 1910 */
134
7
,
1347
,
502
,
1347
,
1347
,
1347
,
1617
,
1347
,
1347
,
1347
,
/* 1920 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1662
,
1347
,
1347
,
1347
,
1347
,
/* 1930 */
134
7
,
1347
,
503
,
1675
,
1347
,
1347
,
1657
,
1647
,
505
,
1649
,
/* 1940 */
16
50
,
501
,
502
,
522
,
1347
,
1347
,
1617
,
1646
,
1347
,
1347
,
/* 1950 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
/* 1960 */
134
7
,
1347
,
1347
,
1675
,
1347
,
1347
,
1656
,
1647
,
505
,
1649
,
/* 1970 */
16
50
,
501
,
1347
,
522
,
1347
,
1662
,
1347
,
1646
,
1347
,
1347
,
/* 1980 */
134
7
,
1347
,
503
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
/* 1990 */
134
7
,
1347
,
502
,
1347
,
1347
,
1347
,
1617
,
1347
,
1347
,
1347
,
/* 2000 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1662
,
1347
,
1347
,
1347
,
1347
,
/* 2010 */
134
7
,
1347
,
503
,
1675
,
1347
,
1347
,
277
,
1647
,
505
,
1649
,
/* 2020 */
16
50
,
501
,
502
,
522
,
1347
,
1347
,
1617
,
1646
,
1347
,
1347
,
/* 2030 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1347
,
1646
,
1347
,
1347
,
1347
,
/* 2040 */
134
7
,
1347
,
1347
,
1675
,
1347
,
1347
,
276
,
1647
,
505
,
1649
,
/* 2050 */
16
50
,
501
,
1347
,
522
,
1347
,
1662
,
1347
,
1347
,
1347
,
1347
,
/* 2060 */
134
7
,
1347
,
503
,
1347
,
1662
,
1347
,
1347
,
1347
,
1347
,
1347
,
/* 2070 */
134
7
,
503
,
502
,
1347
,
1347
,
1347
,
1617
,
1347
,
1347
,
1347
,
/* 2080 */
134
7
,
502
,
1347
,
1347
,
1347
,
1617
,
1347
,
1347
,
1347
,
1347
,
/* 2090 */
164
6
,
1347
,
1347
,
1675
,
1347
,
1347
,
278
,
1647
,
505
,
1649
,
/* 2100 */
16
50
,
501
,
1675
,
522
,
1347
,
275
,
1647
,
505
,
1649
,
1650
,
/* 2110 */
501
,
1347
,
522
,
1347
,
1347
,
1347
,
1347
,
1347
,
1662
,
1347
,
/* 2120 */
134
7
,
1347
,
1347
,
1347
,
1347
,
503
,
1347
,
1347
,
1347
,
1347
,
/* 2130 */
134
7
,
1347
,
1347
,
1347
,
1347
,
502
,
1347
,
1347
,
1347
,
1617
,
/* 2140 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
1347
,
/* 2150 */
134
7
,
1347
,
1347
,
1347
,
1347
,
1347
,
1675
,
1347
,
1347
,
261
,
/* 2160 */
164
7
,
505
,
1649
,
1650
,
501
,
1347
,
522
,
};
static
const
YYCODETYPE
yy_lookahead
[]
=
{
/* 0 */
244
,
251
,
246
,
247
,
244
,
248
,
246
,
247
,
290
,
321
,
...
...
@@ -459,7 +459,7 @@ static const YYCODETYPE yy_lookahead[] = {
/* 240 */
192
,
193
,
194
,
195
,
0
,
217
,
218
,
219
,
220
,
221
,
/* 250 */
4
,
80
,
156
,
12
,
13
,
14
,
15
,
16
,
208
,
196
,
/* 260 */
197
,
198
,
199
,
200
,
201
,
202
,
203
,
204
,
205
,
165
,
/* 270 */
166
,
248
,
57
,
169
,
178
,
179
,
238
,
181
,
182
,
183
,
/* 270 */
166
,
248
,
4
,
169
,
178
,
179
,
238
,
181
,
182
,
183
,
/* 280 */
184
,
185
,
186
,
187
,
188
,
189
,
190
,
191
,
192
,
193
,
/* 290 */
194
,
195
,
12
,
13
,
12
,
13
,
14
,
15
,
16
,
276
,
/* 300 */
20
,
0
,
22
,
208
,
60
,
61
,
62
,
63
,
208
,
65
,
...
...
@@ -470,141 +470,141 @@ static const YYCODETYPE yy_lookahead[] = {
/* 350 */
22
,
328
,
329
,
330
,
331
,
277
,
333
,
2
,
57
,
269
,
/* 360 */
80
,
12
,
13
,
14
,
15
,
16
,
276
,
12
,
13
,
14
,
/* 370 */
15
,
16
,
312
,
143
,
336
,
47
,
286
,
0
,
261
,
208
,
/* 380 */
290
,
3
,
102
,
293
,
42
,
43
,
269
,
349
,
12
,
13
,
/* 390 */
151
,
353
,
64
,
113
,
277
,
20
,
20
,
307
,
22
,
20
,
/* 380 */
290
,
57
,
102
,
293
,
42
,
43
,
269
,
349
,
12
,
13
,
/* 390 */
151
,
353
,
64
,
113
,
277
,
20
,
20
,
307
,
22
,
3
,
/* 400 */
310
,
311
,
312
,
313
,
314
,
315
,
245
,
317
,
80
,
248
,
/* 410 */
171
,
172
,
93
,
94
,
95
,
96
,
97
,
98
,
99
,
100
,
/* 420 */
101
,
102
,
103
,
47
,
105
,
106
,
107
,
108
,
109
,
110
,
/* 430 */
102
,
12
,
13
,
14
,
15
,
16
,
156
,
60
,
61
,
269
,
/* 440 */
64
,
113
,
65
,
213
,
214
,
68
,
69
,
277
,
248
,
72
,
/* 450 */
73
,
74
,
20
,
55
,
208
,
80
,
80
,
308
,
178
,
179
,
/* 430 */
102
,
12
,
13
,
14
,
15
,
16
,
156
,
60
,
61
,
91
,
/* 440 */
64
,
113
,
65
,
213
,
214
,
68
,
69
,
0
,
248
,
72
,
/* 450 */
73
,
74
,
20
,
241
,
208
,
80
,
80
,
308
,
178
,
179
,
/* 460 */
260
,
181
,
182
,
183
,
184
,
185
,
186
,
187
,
188
,
189
,
/* 470 */
190
,
191
,
192
,
193
,
194
,
195
,
276
,
7
9
,
102
,
14
,
/* 480 */
82
,
332
,
60
,
61
,
156
,
20
,
241
,
65
,
208
,
113
,
/* 490 */
68
,
69
,
269
,
296
,
72
,
73
,
74
,
148
,
275
,
91
,
/* 500 */
81
,
22
,
2
41
,
280
,
75
,
248
,
178
,
179
,
273
,
181
,
/* 470 */
190
,
191
,
192
,
193
,
194
,
195
,
276
,
20
9
,
102
,
14
,
/* 480 */
14
,
332
,
60
,
61
,
156
,
20
,
20
,
65
,
208
,
113
,
/* 490 */
68
,
69
,
269
,
296
,
72
,
73
,
74
,
148
,
275
,
44
,
/* 500 */
81
,
22
,
2
90
,
280
,
57
,
248
,
178
,
179
,
273
,
181
,
/* 510 */
182
,
183
,
184
,
185
,
186
,
187
,
188
,
189
,
190
,
191
,
/* 520 */
192
,
193
,
194
,
195
,
14
5
,
290
,
47
,
12
,
13
,
14
,
/* 530 */
15
,
16
,
156
,
336
,
245
,
290
,
269
,
248
,
286
,
241
,
/* 540 */
305
,
306
,
307
,
64
,
292
,
241
,
349
,
280
,
119
,
120
,
/* 550 */
353
,
290
,
317
,
296
,
178
,
179
,
241
,
181
,
182
,
183
,
/* 520 */
192
,
193
,
194
,
195
,
5
5
,
290
,
47
,
12
,
13
,
14
,
/* 530 */
15
,
16
,
156
,
336
,
245
,
80
,
269
,
248
,
14
,
241
,
/* 540 */
305
,
306
,
307
,
64
,
20
,
75
,
349
,
280
,
79
,
241
,
/* 550 */
353
,
82
,
317
,
296
,
178
,
179
,
241
,
181
,
182
,
183
,
/* 560 */
184
,
185
,
186
,
187
,
188
,
189
,
190
,
191
,
192
,
193
,
/* 570 */
194
,
195
,
12
,
13
,
18
,
248
,
20
,
145
,
229
,
253
,
/* 580 */
20
,
102
,
22
,
27
,
269
,
248
,
30
,
260
,
290
,
255
,
/* 590 */
256
,
276
,
113
,
336
,
290
,
241
,
33
,
260
,
241
,
241
,
/* 600 */
274
,
286
,
2
24
,
276
,
48
,
290
,
349
,
47
,
45
,
248
,
/* 580 */
20
,
102
,
22
,
27
,
269
,
248
,
30
,
260
,
290
,
119
,
/* 590 */
120
,
276
,
113
,
336
,
269
,
241
,
33
,
260
,
290
,
308
,
/* 600 */
274
,
286
,
2
77
,
276
,
48
,
290
,
349
,
47
,
45
,
248
,
/* 610 */
353
,
296
,
241
,
276
,
51
,
52
,
53
,
54
,
55
,
35
,
/* 620 */
20
,
260
,
307
,
4
,
64
,
310
,
311
,
312
,
313
,
314
,
/* 630 */
315
,
248
,
317
,
79
,
20
,
156
,
22
,
276
,
248
,
0
,
/* 640 */
80
,
87
,
79
,
260
,
290
,
82
,
241
,
290
,
290
,
255
,
/* 650 */
256
,
336
,
20
,
1
,
2
,
285
,
286
,
178
,
179
,
276
,
/* 620 */
224
,
260
,
307
,
332
,
64
,
310
,
311
,
312
,
313
,
314
,
/* 630 */
315
,
248
,
317
,
79
,
20
,
156
,
22
,
276
,
248
,
21
,
/* 640 */
80
,
87
,
79
,
260
,
290
,
82
,
241
,
182
,
182
,
1
,
/* 650 */
2
,
336
,
34
,
241
,
255
,
256
,
37
,
178
,
179
,
276
,
/* 660 */
145
,
290
,
102
,
49
,
349
,
241
,
276
,
83
,
353
,
85
,
/* 670 */
86
,
37
,
88
,
113
,
118
,
241
,
92
,
121
,
122
,
123
,
/* 670 */
86
,
20
,
88
,
113
,
118
,
241
,
92
,
121
,
122
,
123
,
/* 680 */
124
,
125
,
126
,
127
,
128
,
129
,
130
,
131
,
132
,
133
,
/* 690 */
134
,
135
,
136
,
137
,
138
,
290
,
57
,
248
,
248
,
115
,
/* 700 */
248
,
147
,
41
,
140
,
314
,
142
,
0
,
144
,
248
,
260
,
/* 710 */
260
,
241
,
260
,
139
,
290
,
241
,
156
,
241
,
241
,
329
,
/* 720 */
330
,
331
,
21
,
333
,
290
,
276
,
276
,
164
,
276
,
24
1
,
/* 730 */
241
,
241
,
241
,
81
,
160
,
34
,
276
,
241
,
178
,
179
,
/* 740 */
92
,
181
,
182
,
183
,
184
,
185
,
186
,
187
,
188
,
189
,
/* 750 */
190
,
191
,
192
,
193
,
194
,
195
,
248
,
41
,
269
,
248
,
/* 760 */
2
90
,
241
,
276
,
115
,
290
,
276
,
290
,
290
,
260
,
283
,
/* 770 */
196
,
260
,
42
,
43
,
314
,
286
,
206
,
207
,
290
,
290
,
/* 780 */
290
,
290
,
14
,
308
,
276
,
296
,
290
,
276
,
20
,
329
,
/* 790 */
330
,
331
,
262
,
333
,
0
,
265
,
307
,
81
,
92
,
310
,
/* 800 */
311
,
312
,
313
,
314
,
315
,
241
,
317
,
332
,
84
,
320
,
/* 810 */
290
,
87
,
84
,
324
,
325
,
87
,
84
,
111
,
112
,
87
,
/* 820 */
114
,
115
,
116
,
0
,
257
,
336
,
259
,
84
,
209
,
14
,
/* 830 */
87
,
0
,
41
,
269
,
0
,
20
,
167
,
168
,
349
,
45
,
/* 840 */
276
,
207
,
353
,
41
,
18
,
22
,
41
,
145
,
146
,
23
,
/* 850 */
286
,
1
,
2
,
22
,
290
,
44
,
22
,
193
,
194
,
41
,
/* 860 */
296
,
35
,
36
,
41
,
64
,
39
,
241
,
270
,
41
,
270
,
/* 870 */
41
,
307
,
81
,
270
,
310
,
311
,
312
,
313
,
314
,
315
,
/* 880 */
4
,
317
,
56
,
81
,
320
,
41
,
81
,
226
,
324
,
325
,
/* 890 */
41
,
80
,
80
,
41
,
269
,
19
,
270
,
270
,
242
,
81
,
/* 900 */
336
,
276
,
90
,
2
99
,
41
,
47
,
80
,
47
,
81
,
33
,
/* 910 */
81
,
286
,
41
,
349
,
356
,
290
,
0
,
353
,
258
,
241
,
/* 920 */
41
,
45
,
41
,
347
,
303
,
81
,
50
,
41
,
341
,
247
,
/* 930 */
81
,
55
,
307
,
81
,
249
,
310
,
311
,
312
,
313
,
314
,
/* 940 */
315
,
41
,
317
,
117
,
81
,
320
,
41
,
269
,
2
69
,
324
,
/* 950 */
325
,
326
,
81
,
2
79
,
276
,
79
,
309
,
334
,
82
,
350
,
/* 960 */
81
,
47
,
81
,
338
,
286
,
350
,
350
,
81
,
290
,
344
,
/* 970 */
345
,
113
,
241
,
113
,
148
,
149
,
150
,
337
,
64
,
153
,
/* 980 */
20
,
81
,
248
,
45
,
158
,
307
,
81
,
304
,
310
,
311
,
/* 990 */
312
,
313
,
314
,
315
,
47
,
317
,
170
,
255
,
248
,
173
,
/* 1000 */
269
,
175
,
176
,
177
,
297
,
154
,
248
,
276
,
92
,
40
,
/* 1010 */
2
84
,
139
,
248
,
20
,
243
,
282
,
243
,
286
,
282
,
20
,
/* 1020 */
301
,
290
,
253
,
286
,
20
,
253
,
348
,
111
,
112
,
294
,
/* 1030 */
114
,
115
,
116
,
2
53
,
208
,
276
,
20
,
253
,
307
,
0
,
/* 1040 */
2
87
,
310
,
311
,
312
,
313
,
314
,
315
,
241
,
317
,
253
,
/* 1050 */
2
28
,
320
,
248
,
243
,
253
,
324
,
325
,
326
,
269
,
269
,
/* 1060 */
21
,
2
69
,
269
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
/* 1070 */
31
,
32
,
269
,
24
8
,
64
,
269
,
345
,
269
,
269
,
243
,
/* 1080 */
241
,
2
51
,
276
,
269
,
301
,
269
,
269
,
290
,
269
,
163
,
/* 1090 */
20
,
251
,
286
,
286
,
251
,
300
,
290
,
276
,
251
,
21
6
,
/* 1100 */
3
46
,
346
,
215
,
223
,
343
,
342
,
222
,
294
,
269
,
211
,
/* 1110 */
2
90
,
287
,
210
,
307
,
340
,
276
,
310
,
311
,
312
,
313
,
/* 1120 */
314
,
315
,
290
,
317
,
29
1
,
286
,
320
,
339
,
291
,
290
,
/* 1130 */
324
,
325
,
326
,
2
76
,
207
,
290
,
20
,
309
,
40
,
227
,
/* 1140 */
2
25
,
335
,
241
,
308
,
357
,
80
,
307
,
230
,
142
,
310
,
/* 1150 */
311
,
312
,
313
,
314
,
315
,
291
,
317
,
290
,
290
,
320
,
/* 1160 */
291
,
288
,
287
,
324
,
325
,
326
,
276
,
290
,
327
,
251
,
/* 1170 */
269
,
2
65
,
251
,
276
,
335
,
80
,
272
,
276
,
323
,
259
,
/* 1180 */
2
48
,
251
,
243
,
298
,
302
,
263
,
295
,
286
,
263
,
252
,
/* 1190 */
352
,
290
,
263
,
351
,
0
,
239
,
241
,
0
,
352
,
351
,
/* 1200 */
72
,
0
,
47
,
174
,
351
,
241
,
352
,
47
,
307
,
47
,
/* 1210 */
47
,
310
,
311
,
312
,
313
,
314
,
315
,
174
,
317
,
0
,
/* 690 */
134
,
135
,
136
,
137
,
138
,
290
,
20
,
248
,
248
,
115
,
/* 700 */
248
,
147
,
290
,
140
,
314
,
142
,
0
,
144
,
248
,
260
,
/* 710 */
260
,
20
,
260
,
139
,
290
,
241
,
156
,
241
,
241
,
329
,
/* 720 */
330
,
331
,
41
,
333
,
290
,
276
,
276
,
164
,
276
,
8
1
,
/* 730 */
241
,
241
,
241
,
241
,
160
,
41
,
276
,
241
,
178
,
179
,
/* 740 */
20
,
181
,
182
,
183
,
184
,
185
,
186
,
187
,
188
,
189
,
/* 750 */
190
,
191
,
192
,
193
,
194
,
195
,
248
,
262
,
269
,
248
,
/* 760 */
2
65
,
241
,
241
,
241
,
290
,
276
,
290
,
290
,
260
,
276
,
/* 770 */
196
,
260
,
255
,
256
,
314
,
286
,
283
,
42
,
43
,
290
,
/* 780 */
290
,
290
,
290
,
241
,
276
,
296
,
290
,
276
,
286
,
329
,
/* 790 */
330
,
331
,
0
,
333
,
292
,
257
,
307
,
259
,
92
,
310
,
/* 800 */
311
,
312
,
313
,
314
,
315
,
241
,
317
,
92
,
41
,
320
,
/* 810 */
290
,
290
,
290
,
324
,
325
,
285
,
286
,
111
,
112
,
0
,
/* 820 */
114
,
115
,
116
,
206
,
207
,
336
,
207
,
64
,
84
,
0
,
/* 830 */
115
,
87
,
290
,
269
,
167
,
168
,
145
,
45
,
349
,
270
,
/* 840 */
276
,
22
,
353
,
84
,
18
,
0
,
87
,
270
,
81
,
23
,
/* 850 */
286
,
22
,
84
,
84
,
290
,
87
,
87
,
41
,
182
,
41
,
/* 860 */
296
,
35
,
36
,
145
,
146
,
39
,
241
,
22
,
41
,
1
,
/* 870 */
2
,
307
,
193
,
194
,
310
,
311
,
312
,
313
,
314
,
315
,
/* 880 */
4
,
317
,
56
,
41
,
320
,
41
,
270
,
41
,
324
,
325
,
/* 890 */
41
,
270
,
80
,
41
,
269
,
19
,
270
,
81
,
299
,
81
,
/* 900 */
336
,
276
,
90
,
2
42
,
41
,
47
,
80
,
226
,
81
,
33
,
/* 910 */
258
,
286
,
41
,
349
,
47
,
290
,
0
,
353
,
356
,
241
,
/* 920 */
41
,
45
,
228
,
81
,
341
,
81
,
50
,
81
,
347
,
269
,
/* 930 */
81
,
55
,
307
,
81
,
303
,
310
,
311
,
312
,
313
,
314
,
/* 940 */
315
,
41
,
317
,
117
,
81
,
320
,
41
,
269
,
2
47
,
324
,
/* 950 */
325
,
326
,
81
,
2
49
,
276
,
79
,
279
,
334
,
82
,
309
,
/* 960 */
81
,
350
,
350
,
338
,
286
,
41
,
337
,
20
,
290
,
344
,
/* 970 */
345
,
113
,
241
,
41
,
148
,
149
,
150
,
350
,
41
,
153
,
/* 980 */
113
,
81
,
248
,
45
,
158
,
307
,
81
,
47
,
310
,
311
,
/* 990 */
312
,
313
,
314
,
315
,
304
,
317
,
170
,
47
,
255
,
173
,
/* 1000 */
269
,
175
,
176
,
177
,
64
,
81
,
297
,
276
,
92
,
154
,
/* 1010 */
2
48
,
40
,
248
,
81
,
284
,
282
,
139
,
286
,
81
,
282
,
/* 1020 */
248
,
290
,
20
,
243
,
243
,
20
,
348
,
111
,
112
,
301
,
/* 1030 */
114
,
115
,
116
,
2
86
,
208
,
253
,
253
,
20
,
307
,
0
,
/* 1040 */
2
94
,
310
,
311
,
312
,
313
,
314
,
315
,
241
,
317
,
253
,
/* 1050 */
2
76
,
320
,
20
,
287
,
253
,
324
,
325
,
326
,
253
,
248
,
/* 1060 */
21
,
2
53
,
269
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
/* 1070 */
31
,
32
,
269
,
24
3
,
243
,
269
,
345
,
64
,
269
,
269
,
/* 1080 */
241
,
2
48
,
276
,
269
,
269
,
290
,
269
,
301
,
251
,
269
,
/* 1090 */
269
,
269
,
286
,
269
,
163
,
20
,
290
,
300
,
251
,
28
6
,
/* 1100 */
3
09
,
294
,
251
,
216
,
276
,
251
,
346
,
215
,
269
,
223
,
/* 1110 */
2
87
,
346
,
222
,
307
,
343
,
276
,
310
,
311
,
312
,
313
,
/* 1120 */
314
,
315
,
290
,
317
,
29
0
,
286
,
320
,
291
,
290
,
290
,
/* 1130 */
324
,
325
,
326
,
2
11
,
291
,
210
,
342
,
207
,
340
,
339
,
/* 1140 */
2
76
,
335
,
241
,
20
,
40
,
227
,
307
,
230
,
308
,
310
,
/* 1150 */
311
,
312
,
313
,
314
,
315
,
351
,
317
,
291
,
225
,
320
,
/* 1160 */
80
,
291
,
327
,
324
,
325
,
326
,
142
,
276
,
290
,
265
,
/* 1170 */
269
,
2
90
,
290
,
288
,
335
,
287
,
80
,
276
,
251
,
323
,
/* 1180 */
2
51
,
272
,
357
,
276
,
248
,
259
,
251
,
286
,
243
,
0
,
/* 1190 */
295
,
290
,
298
,
352
,
252
,
302
,
241
,
263
,
239
,
0
,
/* 1200 */
352
,
351
,
263
,
72
,
351
,
241
,
263
,
0
,
307
,
352
,
/* 1210 */
47
,
310
,
311
,
312
,
313
,
314
,
315
,
174
,
317
,
47
,
/* 1220 */
47
,
320
,
47
,
174
,
269
,
324
,
325
,
326
,
0
,
47
,
/* 1230 */
0
,
276
,
47
,
269
,
0
,
47
,
335
,
0
,
80
,
16
0
,
/* 1240 */
276
,
286
,
159
,
113
,
156
,
290
,
152
,
151
,
0
,
0
,
/* 1250 */
286
,
0
,
0
,
44
,
290
,
0
,
0
,
0
,
0
,
241
,
/* 1230 */
47
,
276
,
0
,
269
,
174
,
47
,
335
,
0
,
47
,
0
,
/* 1240 */
276
,
286
,
47
,
0
,
80
,
290
,
160
,
159
,
113
,
156
,
/* 1250 */
286
,
0
,
0
,
152
,
290
,
0
,
151
,
0
,
44
,
241
,
/* 1260 */
296
,
0
,
307
,
0
,
0
,
310
,
311
,
312
,
313
,
314
,
/* 1270 */
315
,
307
,
317
,
0
,
310
,
311
,
312
,
313
,
314
,
315
,
/* 1280 */
0
,
317
,
0
,
0
,
0
,
0
,
0
,
269
,
0
,
0
,
/* 1290 */
0
,
0
,
0
,
40
,
276
,
0
,
0
,
0
,
0
,
241
,
/* 1300 */
336
,
0
,
0
,
22
,
286
,
0
,
0
,
0
,
290
,
40
,
/* 1310 */
355
,
0
,
0
,
349
,
37
,
41
,
44
,
353
,
241
,
44
,
/* 1320 */
0
,
0
,
14
,
0
,
14
,
307
,
0
,
269
,
310
,
311
,
/* 1330 */
312
,
313
,
314
,
315
,
276
,
317
,
0
,
38
,
320
,
45
,
/* 1340 */
37
,
37
,
324
,
325
,
286
,
0
,
269
,
0
,
290
,
0
,
/* 1350 */
0
,
3
7
,
59
,
276
,
37
,
0
,
0
,
0
,
0
,
37
,
/* 1360 */
47
,
45
,
4
7
,
286
,
37
,
307
,
47
,
290
,
310
,
311
,
/* 1370 */
312
,
313
,
314
,
315
,
241
,
317
,
4
5
,
47
,
320
,
45
,
/* 1380 */
0
,
0
,
324
,
325
,
307
,
47
,
0
,
310
,
311
,
312
,
/* 1390 */
313
,
314
,
315
,
316
,
317
,
318
,
319
,
22
,
47
,
47
,
/* 1400 */
47
,
47
,
269
,
19
,
41
,
0
,
41
,
89
,
47
,
276
,
/* 1410 */
22
,
87
,
0
,
47
,
47
,
22
,
48
,
33
,
0
,
286
,
/* 1420 */
22
,
47
,
0
,
290
,
22
,
0
,
22
,
20
,
0
,
45
,
/* 1430 */
47
,
0
,
145
,
241
,
0
,
51
,
52
,
53
,
54
,
55
,
/* 1440 */
307
,
22
,
142
,
310
,
311
,
312
,
313
,
314
,
315
,
0
,
/* 1450 */
317
,
0
,
80
,
320
,
37
,
41
,
41
,
212
,
325
,
8
1
,
/* 1460 */
81
,
269
,
41
,
79
,
41
,
80
,
82
,
80
,
276
,
140
,
/* 1470 */
80
,
44
,
81
,
145
,
80
,
2
,
41
,
212
,
286
,
41
,
/* 1480 */
8
1
,
81
,
290
,
44
,
206
,
293
,
161
,
241
,
44
,
81
,
/* 1490 */
81
,
12
,
13
,
41
,
47
,
47
,
41
,
47
,
44
,
307
,
/* 1290 */
0
,
0
,
0
,
0
,
276
,
0
,
0
,
0
,
4
0
,
241
,
/* 1300 */
336
,
0
,
0
,
0
,
286
,
0
,
0
,
0
,
290
,
22
,
/* 1310 */
355
,
0
,
0
,
349
,
0
,
0
,
0
,
353
,
241
,
40
,
/* 1320 */
0
,
44
,
41
,
45
,
14
,
307
,
0
,
269
,
310
,
311
,
/* 1330 */
312
,
313
,
314
,
315
,
276
,
317
,
37
,
14
,
320
,
45
,
/* 1340 */
0
,
37
,
324
,
325
,
286
,
0
,
269
,
0
,
290
,
0
,
/* 1350 */
0
,
3
8
,
44
,
276
,
37
,
0
,
0
,
59
,
37
,
0
,
/* 1360 */
0
,
37
,
3
7
,
286
,
37
,
307
,
47
,
290
,
310
,
311
,
/* 1370 */
312
,
313
,
314
,
315
,
241
,
317
,
4
7
,
47
,
320
,
45
,
/* 1380 */
47
,
45
,
324
,
325
,
307
,
0
,
0
,
310
,
311
,
312
,
/* 1390 */
313
,
314
,
315
,
316
,
317
,
318
,
319
,
0
,
0
,
47
,
/* 1400 */
22
,
0
,
269
,
19
,
47
,
47
,
41
,
89
,
47
,
276
,
/* 1410 */
47
,
41
,
0
,
47
,
47
,
87
,
22
,
33
,
47
,
286
,
/* 1420 */
48
,
22
,
0
,
290
,
0
,
22
,
47
,
0
,
22
,
45
,
/* 1430 */
0
,
22
,
0
,
241
,
2
0
,
51
,
52
,
53
,
54
,
55
,
/* 1440 */
307
,
0
,
47
,
310
,
311
,
312
,
313
,
314
,
315
,
0
,
/* 1450 */
317
,
22
,
0
,
320
,
0
,
80
,
37
,
41
,
325
,
4
1
,
/* 1460 */
212
,
269
,
81
,
79
,
41
,
44
,
82
,
145
,
276
,
81
,
/* 1470 */
80
,
80
,
80
,
206
,
81
,
41
,
145
,
142
,
286
,
44
,
/* 1480 */
8
0
,
140
,
290
,
41
,
212
,
293
,
81
,
241
,
81
,
44
,
/* 1490 */
44
,
12
,
13
,
161
,
41
,
47
,
81
,
41
,
81
,
307
,
/* 1500 */
116
,
22
,
310
,
311
,
312
,
313
,
314
,
315
,
47
,
317
,
/* 1510 */
47
,
47
,
80
,
178
,
81
,
269
,
44
,
241
,
81
,
22
,
/* 1520 */
80
,
80
,
276
,
180
,
81
,
141
,
47
,
81
,
144
,
0
,
/* 1530 */
37
,
44
,
286
,
80
,
44
,
143
,
290
,
80
,
80
,
80
,
/* 1540 */
80
,
140
,
80
,
64
,
212
,
269
,
162
,
81
,
164
,
80
,
/* 1550 */
241
,
80
,
276
,
307
,
22
,
90
,
310
,
311
,
312
,
313
,
/* 1560 */
314
,
315
,
286
,
317
,
4
7
,
319
,
290
,
91
,
47
,
293
,
/* 1570 */
81
,
80
,
47
,
81
,
80
,
47
,
81
,
81
,
269
,
80
,
/* 1580 */
241
,
102
,
47
,
307
,
80
,
276
,
310
,
311
,
312
,
313
,
/* 1590 */
314
,
315
,
113
,
317
,
81
,
286
,
47
,
22
,
80
,
290
,
/* 1600 */
92
,
47
,
293
,
80
,
104
,
47
,
104
,
104
,
269
,
104
,
/* 1610 */
241
,
80
,
248
,
80
,
22
,
276
,
307
,
64
,
59
,
310
,
/* 1620 */
311
,
312
,
313
,
314
,
315
,
286
,
317
,
113
,
58
,
290
,
/* 1630 */
78
,
41
,
47
,
47
,
47
,
156
,
47
,
22
,
269
,
0
,
/* 1640 */
276
,
47
,
47
,
47
,
64
,
276
,
307
,
47
,
47
,
310
,
/* 1510 */
47
,
47
,
212
,
47
,
47
,
269
,
2
,
241
,
41
,
81
,
/* 1520 */
178
,
81
,
276
,
80
,
44
,
141
,
47
,
80
,
144
,
44
,
/* 1530 */
80
,
22
,
286
,
180
,
0
,
80
,
290
,
37
,
81
,
81
,
/* 1540 */
80
,
90
,
80
,
64
,
22
,
269
,
162
,
143
,
164
,
80
,
/* 1550 */
241
,
140
,
276
,
307
,
80
,
44
,
310
,
311
,
312
,
313
,
/* 1560 */
314
,
315
,
286
,
317
,
4
4
,
319
,
290
,
80
,
80
,
293
,
/* 1570 */
81
,
80
,
91
,
81
,
47
,
47
,
80
,
47
,
269
,
81
,
/* 1580 */
241
,
102
,
80
,
307
,
81
,
276
,
310
,
311
,
312
,
313
,
/* 1590 */
314
,
315
,
113
,
317
,
47
,
286
,
81
,
80
,
47
,
290
,
/* 1600 */
81
,
80
,
293
,
47
,
80
,
22
,
47
,
113
,
269
,
104
,
/* 1610 */
241
,
104
,
248
,
80
,
104
,
276
,
307
,
104
,
92
,
310
,
/* 1620 */
311
,
312
,
313
,
314
,
315
,
286
,
317
,
47
,
80
,
290
,
/* 1630 */
80
,
22
,
59
,
58
,
64
,
156
,
78
,
41
,
269
,
47
,
/* 1640 */
276
,
47
,
47
,
22
,
47
,
276
,
307
,
47
,
47
,
310
,
/* 1650 */
311
,
312
,
313
,
314
,
315
,
286
,
317
,
178
,
47
,
290
,
/* 1660 */
296
,
241
,
37
,
47
,
47
,
47
,
47
,
47
,
189
,
190
,
/* 1670 */
191
,
0
,
45
,
37
,
45
,
47
,
307
,
241
,
314
,
310
,
/* 1680 */
311
,
312
,
313
,
314
,
315
,
0
,
317
,
47
,
45
,
269
,
/* 1690 */
37
,
0
,
47
,
329
,
330
,
331
,
276
,
333
,
37
,
45
,
/* 1700 */
336
,
0
,
4
7
,
46
,
0
,
269
,
286
,
0
,
22
,
21
,
/* 1710 */
290
,
22
,
276
,
349
,
22
,
21
,
20
,
353
,
358
,
358
,
/* 1720 */
358
,
358
,
286
,
358
,
241
,
358
,
290
,
307
,
358
,
358
,
/* 1660 */
296
,
241
,
64
,
47
,
47
,
47
,
47
,
47
,
189
,
190
,
/* 1670 */
191
,
47
,
47
,
0
,
47
,
45
,
307
,
241
,
314
,
310
,
/* 1680 */
311
,
312
,
313
,
314
,
315
,
37
,
317
,
0
,
47
,
269
,
/* 1690 */
45
,
37
,
0
,
329
,
330
,
331
,
276
,
333
,
47
,
37
,
/* 1700 */
336
,
0
,
4
5
,
45
,
37
,
269
,
286
,
47
,
0
,
46
,
/* 1710 */
290
,
47
,
276
,
349
,
0
,
0
,
22
,
353
,
21
,
358
,
/* 1720 */
22
,
22
,
286
,
21
,
241
,
20
,
290
,
307
,
358
,
358
,
/* 1730 */
310
,
311
,
312
,
313
,
314
,
315
,
358
,
317
,
358
,
358
,
/* 1740 */
358
,
358
,
241
,
307
,
358
,
358
,
310
,
311
,
312
,
313
,
/* 1750 */
314
,
315
,
269
,
317
,
358
,
358
,
358
,
241
,
358
,
276
,
...
...
@@ -650,9 +650,9 @@ static const YYCODETYPE yy_lookahead[] = {
/* 2150 */
358
,
358
,
358
,
358
,
358
,
358
,
307
,
358
,
358
,
310
,
/* 2160 */
311
,
312
,
313
,
314
,
315
,
358
,
317
,
};
#define YY_SHIFT_COUNT (60
2
)
#define YY_SHIFT_COUNT (60
4
)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (17
07
)
#define YY_SHIFT_MAX (17
15
)
static
const
unsigned
short
int
yy_shift_ofst
[]
=
{
/* 0 */
826
,
0
,
0
,
48
,
96
,
96
,
96
,
96
,
280
,
280
,
/* 10 */
96
,
96
,
328
,
376
,
560
,
376
,
376
,
376
,
376
,
376
,
...
...
@@ -660,63 +660,63 @@ static const unsigned short int yy_shift_ofst[] = {
/* 30 */
376
,
376
,
376
,
376
,
376
,
376
,
376
,
376
,
95
,
95
,
/* 40 */
375
,
375
,
375
,
1479
,
1479
,
1479
,
100
,
50
,
171
,
45
,
/* 50 */
45
,
342
,
342
,
246
,
171
,
171
,
45
,
45
,
45
,
45
,
/* 60 */
45
,
45
,
17
,
45
,
201
,
323
,
6
00
,
201
,
45
,
45
,
/* 70 */
201
,
45
,
201
,
201
,
6
00
,
201
,
45
,
215
,
556
,
63
,
/* 60 */
45
,
45
,
17
,
45
,
201
,
323
,
6
51
,
201
,
45
,
45
,
/* 70 */
201
,
45
,
201
,
201
,
6
51
,
201
,
45
,
324
,
556
,
63
,
/* 80 */
14
,
14
,
13
,
479
,
422
,
479
,
479
,
479
,
479
,
479
,
/* 90 */
479
,
479
,
479
,
479
,
479
,
479
,
479
,
479
,
479
,
479
,
/* 100 */
479
,
479
,
479
,
479
,
584
,
614
,
465
,
465
,
301
,
281
,
/* 110 */
379
,
379
,
379
,
639
,
281
,
632
,
600
,
201
,
201
,
600
,
/* 120 */
408
,
800
,
319
,
319
,
319
,
319
,
319
,
319
,
319
,
1384
,
/* 130 */
1039
,
377
,
349
,
28
,
104
,
230
,
730
,
102
,
648
,
43
2
,
/* 140 */
570
,
634
,
570
,
768
,
378
,
378
,
378
,
619
,
815
,
960
,
/* 150 */
9
38
,
947
,
851
,
960
,
960
,
969
,
872
,
872
,
960
,
993
,
/* 160 */
993
,
999
,
17
,
600
,
17
,
1004
,
17
,
632
,
1016
,
17
,
/* 170 */
17
,
960
,
17
,
993
,
201
,
201
,
201
,
201
,
201
,
201
,
/* 180 */
201
,
201
,
201
,
201
,
201
,
960
,
993
,
1010
,
999
,
21
5
,
/* 190 */
926
,
600
,
215
,
1004
,
215
,
632
,
1016
,
215
,
1070
,
883
,
/* 200 */
887
,
1010
,
883
,
887
,
1010
,
1010
,
880
,
884
,
898
,
902
,
/* 210 */
92
7
,
632
,
1116
,
1098
,
912
,
915
,
917
,
912
,
915
,
912
,
/* 220 */
9
15
,
1065
,
201
,
887
,
1010
,
1010
,
887
,
1010
,
1006
,
632
,
/* 230 */
1016
,
215
,
408
,
215
,
632
,
1095
,
800
,
960
,
215
,
993
,
/* 240 */
2167
,
2167
,
2167
,
2167
,
2167
,
2167
,
2167
,
2167
,
244
,
563
,
/* 250 */
141
,
876
,
706
,
916
,
241
,
84
,
355
,
515
,
419
,
85
,
/* 260 */
282
,
282
,
282
,
282
,
282
,
282
,
282
,
282
,
239
,
398
,
/* 270 */
4
29
,
554
,
652
,
574
,
36
,
36
,
36
,
36
,
794
,
716
,
/* 280 */
7
24
,
728
,
732
,
743
,
823
,
831
,
834
,
701
,
669
,
702
,
/* 290 */
7
91
,
802
,
805
,
850
,
664
,
661
,
822
,
818
,
145
,
827
,
/* 300 */
8
11
,
829
,
844
,
849
,
852
,
863
,
858
,
860
,
871
,
879
,
/* 310 */
881
,
886
,
900
,
905
,
812
,
914
,
1194
,
1197
,
1128
,
120
1
,
/* 320 */
1
155
,
1029
,
1160
,
1162
,
1163
,
1043
,
1219
,
1173
,
1175
,
1049
,
/* 330 */
1
228
,
1182
,
1230
,
1185
,
1234
,
1188
,
1237
,
1158
,
1079
,
1083
,
/* 340 */
1
130
,
1088
,
1251
,
1252
,
1094
,
1096
,
1248
,
1249
,
1209
,
1255
,
/* 350 */
12
56
,
1257
,
1258
,
1261
,
1263
,
1264
,
1273
,
1280
,
1282
,
1283
,
/* 360 */
128
4
,
1285
,
1286
,
1288
,
1289
,
1290
,
1291
,
1253
,
1292
,
1295
,
/* 370 */
1
296
,
1297
,
1298
,
1301
,
1281
,
1302
,
1305
,
1306
,
1307
,
1311
,
/* 380 */
131
2
,
1269
,
1277
,
1274
,
1308
,
1272
,
1310
,
1275
,
1320
,
1299
,
/* 390 */
13
03
,
1321
,
1323
,
1326
,
1336
,
1304
,
1345
,
1293
,
1347
,
1349
,
/* 400 */
13
13
,
1294
,
1314
,
1350
,
1315
,
1316
,
1317
,
1355
,
1319
,
1331
,
/* 410 */
13
22
,
1356
,
1330
,
1334
,
1327
,
1357
,
1358
,
1380
,
1381
,
131
8
,
/* 420 */
13
24
,
1338
,
1375
,
1386
,
1351
,
1352
,
1353
,
1354
,
1363
,
1365
,
/* 430 */
13
61
,
1366
,
1367
,
1405
,
1388
,
1412
,
1393
,
1368
,
1418
,
1398
,
/* 440 */
1
374
,
1422
,
1402
,
1425
,
1404
,
1407
,
1428
,
1287
,
1383
,
1431
,
/* 450 */
1
325
,
1419
,
1328
,
1300
,
1434
,
1449
,
1451
,
1372
,
1417
,
132
9
,
/* 460 */
1
414
,
1415
,
1245
,
1378
,
1421
,
1379
,
1385
,
1387
,
1390
,
1391
,
/* 470 */
1
423
,
1427
,
1394
,
1435
,
1265
,
1399
,
1400
,
1439
,
1278
,
1438
,
/* 480 */
1
444
,
1408
,
1452
,
1332
,
1409
,
1447
,
1448
,
1450
,
1461
,
1463
,
/* 490 */
1464
,
14
09
,
1473
,
1335
,
1455
,
1433
,
1432
,
1437
,
1454
,
1440
,
/* 500 */
14
41
,
1472
,
1497
,
1343
,
1453
,
1443
,
1446
,
1457
,
1458
,
1392
,
/* 510 */
14
59
,
1529
,
1493
,
1401
,
1460
,
1465
,
1487
,
1490
,
1462
,
1466
,
/* 520 */
14
69
,
1532
,
1471
,
1476
,
1489
,
1517
,
1521
,
1491
,
1492
,
1525
,
/* 530 */
149
4
,
1495
,
1528
,
1499
,
1496
,
1535
,
1504
,
1513
,
1549
,
1518
,
/* 540 */
15
00
,
1502
,
1503
,
1505
,
1575
,
1508
,
1523
,
1531
,
1554
,
1533
,
/* 550 */
15
14
,
1558
,
1592
,
1559
,
1570
,
1553
,
1552
,
1590
,
1585
,
158
6
,
/* 560 */
15
87
,
1589
,
1594
,
1615
,
1595
,
1596
,
1580
,
1363
,
1600
,
1365
,
/* 570 */
16
01
,
1611
,
1616
,
1617
,
1618
,
1619
,
1639
,
1620
,
1627
,
1625
,
/* 580 */
16
71
,
1628
,
1629
,
1636
,
1685
,
1640
,
1643
,
1653
,
1691
,
1645
,
/* 590 */
1
654
,
1661
,
1701
,
1655
,
1657
,
1704
,
1707
,
1686
,
1688
,
1689
,
/* 600 */
169
2
,
1694
,
1696
,
/* 100 */
479
,
479
,
479
,
479
,
584
,
614
,
524
,
524
,
301
,
281
,
/* 110 */
432
,
432
,
432
,
447
,
281
,
720
,
651
,
201
,
201
,
651
,
/* 120 */
348
,
763
,
319
,
319
,
319
,
319
,
319
,
319
,
319
,
1384
,
/* 130 */
1039
,
377
,
349
,
28
,
104
,
230
,
465
,
466
,
735
,
10
2
,
/* 140 */
715
,
691
,
617
,
619
,
617
,
396
,
396
,
396
,
268
,
676
,
/* 150 */
9
47
,
938
,
950
,
855
,
947
,
947
,
971
,
877
,
877
,
947
,
/* 160 */
1002
,
1002
,
1005
,
17
,
651
,
17
,
1017
,
17
,
720
,
1032
,
/* 170 */
17
,
17
,
947
,
17
,
1002
,
201
,
201
,
201
,
201
,
201
,
/* 180 */
201
,
201
,
201
,
201
,
201
,
201
,
947
,
1002
,
1013
,
100
5
,
/* 190 */
324
,
931
,
651
,
324
,
1017
,
324
,
720
,
1032
,
324
,
1075
,
/* 200 */
887
,
892
,
1013
,
887
,
892
,
1013
,
1013
,
201
,
886
,
890
,
/* 210 */
92
2
,
925
,
930
,
720
,
1123
,
1104
,
918
,
933
,
917
,
918
,
/* 220 */
9
33
,
918
,
933
,
1080
,
892
,
1013
,
1013
,
892
,
1013
,
1024
,
/* 230 */
720
,
1032
,
324
,
348
,
324
,
720
,
1096
,
763
,
947
,
324
,
/* 240 */
1002
,
2167
,
2167
,
2167
,
2167
,
2167
,
2167
,
2167
,
2167
,
244
,
/* 250 */
563
,
141
,
876
,
706
,
916
,
241
,
84
,
355
,
515
,
419
,
/* 260 */
85
,
282
,
282
,
282
,
282
,
282
,
282
,
282
,
282
,
239
,
/* 270 */
4
69
,
470
,
554
,
648
,
574
,
36
,
36
,
36
,
36
,
792
,
/* 280 */
7
67
,
744
,
759
,
768
,
769
,
819
,
829
,
845
,
618
,
667
,
/* 290 */
7
18
,
816
,
818
,
827
,
868
,
679
,
681
,
694
,
842
,
145
,
/* 300 */
8
44
,
455
,
846
,
849
,
852
,
863
,
871
,
858
,
867
,
879
,
/* 310 */
900
,
905
,
924
,
932
,
937
,
812
,
940
,
1189
,
1199
,
113
1
,
/* 320 */
1
207
,
1163
,
1043
,
1172
,
1173
,
1175
,
1049
,
1228
,
1182
,
1183
,
/* 330 */
1
060
,
1232
,
1188
,
1237
,
1191
,
1239
,
1195
,
1243
,
1164
,
1086
,
/* 340 */
1
088
,
1135
,
1093
,
1251
,
1252
,
1101
,
1105
,
1255
,
1257
,
1214
,
/* 350 */
12
61
,
1263
,
1264
,
1273
,
1280
,
1282
,
1283
,
1284
,
1285
,
1286
,
/* 360 */
128
8
,
1289
,
1290
,
1291
,
1292
,
1293
,
1295
,
1296
,
1258
,
1297
,
/* 370 */
1
301
,
1302
,
1303
,
1305
,
1306
,
1287
,
1307
,
1311
,
1312
,
1314
,
/* 380 */
131
5
,
1316
,
1279
,
1299
,
1281
,
1310
,
1277
,
1323
,
1308
,
1320
,
/* 390 */
13
13
,
1304
,
1326
,
1345
,
1347
,
1349
,
1317
,
1350
,
1298
,
1355
,
/* 400 */
13
56
,
1319
,
1278
,
1321
,
1359
,
1329
,
1294
,
1324
,
1340
,
1330
,
/* 410 */
13
34
,
1325
,
1360
,
1333
,
1336
,
1327
,
1385
,
1386
,
1397
,
139
8
,
/* 420 */
13
18
,
1328
,
1352
,
1378
,
1401
,
1357
,
1358
,
1361
,
1363
,
1365
,
/* 430 */
13
70
,
1366
,
1367
,
1371
,
1412
,
1394
,
1424
,
1399
,
1372
,
1422
,
/* 440 */
1
403
,
1379
,
1427
,
1406
,
1430
,
1409
,
1414
,
1432
,
1322
,
1395
,
/* 450 */
1
441
,
1332
,
1429
,
1331
,
1335
,
1449
,
1452
,
1454
,
1375
,
141
9
,
/* 460 */
1
341
,
1416
,
1418
,
1248
,
1381
,
1423
,
1388
,
1390
,
1391
,
1392
,
/* 470 */
1
393
,
1434
,
1421
,
1435
,
1400
,
1442
,
1272
,
1405
,
1407
,
1445
,
/* 480 */
1
267
,
1453
,
1446
,
1415
,
1456
,
1300
,
1417
,
1448
,
1461
,
1463
,
/* 490 */
1464
,
14
66
,
1467
,
1417
,
1514
,
1342
,
1477
,
1438
,
1443
,
1440
,
/* 500 */
14
80
,
1447
,
1450
,
1485
,
1509
,
1353
,
1455
,
1457
,
1458
,
1460
,
/* 510 */
14
62
,
1404
,
1469
,
1534
,
1500
,
1411
,
1474
,
1451
,
1511
,
1520
,
/* 520 */
14
87
,
1489
,
1488
,
1522
,
1491
,
1481
,
1492
,
1527
,
1528
,
1496
,
/* 530 */
149
8
,
1530
,
1502
,
1503
,
1547
,
1517
,
1515
,
1551
,
1521
,
1519
,
/* 540 */
15
56
,
1524
,
1505
,
1507
,
1510
,
1513
,
1583
,
1526
,
1533
,
1548
,
/* 550 */
15
59
,
1550
,
1494
,
1580
,
1609
,
1573
,
1575
,
1570
,
1558
,
159
6
,
/* 560 */
15
92
,
1594
,
1595
,
1597
,
1600
,
1621
,
1601
,
1611
,
1598
,
1365
,
/* 570 */
16
16
,
1370
,
1617
,
1618
,
1619
,
1620
,
1624
,
1625
,
1673
,
1627
,
/* 580 */
16
30
,
1648
,
1687
,
1641
,
1645
,
1654
,
1692
,
1651
,
1657
,
1662
,
/* 590 */
1
701
,
1660
,
1658
,
1667
,
1708
,
1664
,
1663
,
1714
,
1715
,
1694
,
/* 600 */
169
7
,
1698
,
1699
,
1702
,
1705
,
};
#define YY_REDUCE_COUNT (24
7
)
#define YY_REDUCE_COUNT (24
8
)
#define YY_REDUCE_MIN (-317)
#define YY_REDUCE_MAX (1849)
static
const
short
yy_reduce_ofst
[]
=
{
...
...
@@ -728,86 +728,86 @@ static const short yy_reduce_ofst[] = {
/* 50 */
-
112
,
-
244
,
-
240
,
-
317
,
-
202
,
-
190
,
-
243
,
200
,
327
,
361
,
/* 60 */
383
,
449
,
-
152
,
450
,
-
221
,
60
,
-
64
,
-
144
,
337
,
452
,
/* 70 */
55
,
508
,
78
,
223
,
47
,
117
,
511
,
-
250
,
-
177
,
-
312
,
/* 80 */
-
312
,
-
312
,
-
113
,
2
45
,
-
34
,
261
,
298
,
304
,
354
,
357
,
/* 90 */
358
,
371
,
405
,
424
,
434
,
470
,
474
,
476
,
477
,
488
,
/* 100 */
490
,
491
,
496
,
520
,
70
,
-
139
,
161
,
289
,
326
,
334
,
/* 110 */
-
277
,
149
,
475
,
-
114
,
394
,
486
,
252
,
170
,
267
,
37
0
,
/* 120 */
530
,
567
,
-
259
,
-
255
,
597
,
599
,
603
,
626
,
627
,
604
,
/* 130 */
6
56
,
660
,
558
,
576
,
621
,
587
,
682
,
685
,
674
,
647
,
/* 140 */
6
23
,
623
,
623
,
679
,
609
,
615
,
616
,
640
,
679
,
734
,
/* 150 */
683
,
742
,
707
,
750
,
758
,
726
,
733
,
736
,
764
,
771
,
/* 160 */
7
73
,
719
,
769
,
737
,
772
,
735
,
780
,
759
,
753
,
784
,
/* 170 */
796
,
804
,
801
,
810
,
789
,
790
,
792
,
793
,
803
,
808
,
/* 180 */
8
09
,
814
,
816
,
817
,
819
,
825
,
836
,
797
,
783
,
830
,
/* 190 */
795
,
807
,
840
,
813
,
843
,
821
,
824
,
847
,
828
,
754
,
/* 200 */
833
,
820
,
755
,
837
,
832
,
845
,
761
,
763
,
774
,
788
,
/* 210 */
623
,
857
,
835
,
841
,
838
,
842
,
787
,
846
,
848
,
854
,
/* 220 */
85
3
,
855
,
679
,
864
,
867
,
868
,
869
,
877
,
873
,
890
,
/* 230 */
8
75
,
918
,
906
,
921
,
897
,
904
,
920
,
932
,
930
,
939
,
/* 240 */
885
,
882
,
891
,
922
,
925
,
929
,
937
,
956
,
/* 80 */
-
312
,
-
312
,
-
113
,
2
12
,
-
34
,
298
,
308
,
354
,
371
,
405
,
/* 90 */
412
,
424
,
434
,
474
,
476
,
477
,
490
,
491
,
492
,
496
,
/* 100 */
520
,
521
,
522
,
542
,
70
,
-
139
,
161
,
289
,
326
,
399
,
/* 110 */
-
277
,
149
,
291
,
-
114
,
517
,
493
,
502
,
325
,
267
,
53
0
,
/* 120 */
495
,
538
,
-
259
,
-
255
,
569
,
577
,
616
,
621
,
626
,
599
,
/* 130 */
6
61
,
652
,
562
,
581
,
631
,
583
,
660
,
660
,
701
,
704
,
/* 140 */
6
77
,
650
,
623
,
623
,
623
,
611
,
612
,
627
,
629
,
660
,
/* 150 */
734
,
690
,
743
,
709
,
762
,
764
,
730
,
733
,
737
,
772
,
/* 160 */
7
80
,
781
,
728
,
782
,
747
,
783
,
746
,
796
,
774
,
766
,
/* 170 */
801
,
805
,
811
,
808
,
830
,
793
,
803
,
809
,
810
,
814
,
/* 180 */
8
15
,
817
,
820
,
821
,
822
,
824
,
833
,
831
,
795
,
786
,
/* 190 */
837
,
797
,
813
,
847
,
807
,
851
,
828
,
823
,
854
,
791
,
/* 200 */
760
,
836
,
832
,
765
,
843
,
834
,
838
,
660
,
771
,
794
,
/* 210 */
798
,
800
,
623
,
864
,
840
,
835
,
841
,
804
,
825
,
848
,
/* 220 */
85
0
,
857
,
853
,
856
,
866
,
878
,
881
,
870
,
882
,
885
,
/* 230 */
8
91
,
888
,
927
,
904
,
929
,
907
,
909
,
926
,
936
,
935
,
/* 240 */
945
,
894
,
893
,
895
,
934
,
939
,
943
,
942
,
959
,
};
static
const
YYACTIONTYPE
yy_default
[]
=
{
/* 0 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 10 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 20 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 30 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 40 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 50 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 60 */
134
1
,
1341
,
1410
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 70 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1408
,
1548
,
1341
,
/* 80 */
171
2
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 90 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 100 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1410
,
1341
,
/* 110 */
172
3
,
1723
,
1723
,
1408
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 120 */
150
3
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1586
,
/* 130 */
134
1
,
1341
,
1789
,
1341
,
1592
,
1747
,
1341
,
1341
,
1456
,
1739
,
/* 140 */
1
715
,
1729
,
1716
,
1341
,
1774
,
1774
,
1774
,
1732
,
1341
,
1341
,
/* 150 */
134
1
,
1341
,
1578
,
1341
,
1341
,
1553
,
1550
,
1550
,
1341
,
1341
,
/* 160 */
134
1
,
1341
,
1410
,
1341
,
1410
,
1341
,
1410
,
1341
,
1341
,
1410
,
/* 170 */
141
0
,
1341
,
1410
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 180 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1408
,
/* 190 */
1
588
,
1341
,
1408
,
1341
,
1408
,
1341
,
1341
,
1408
,
1341
,
1754
,
/* 200 */
175
2
,
1341
,
1754
,
1752
,
1341
,
1341
,
1766
,
1762
,
1745
,
1743
,
/* 210 */
17
29
,
1341
,
1341
,
1341
,
1780
,
1776
,
1792
,
1780
,
1776
,
1780
,
/* 220 */
17
76
,
1341
,
1341
,
1752
,
1341
,
1341
,
1752
,
1341
,
1561
,
1341
,
/* 230 */
134
1
,
1408
,
1341
,
1408
,
1341
,
1472
,
1341
,
1341
,
1408
,
1341
,
/* 240 */
1
580
,
1594
,
1570
,
1506
,
1506
,
1506
,
1411
,
1346
,
1341
,
1341
,
/* 250 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1468
,
/* 260 */
1
657
,
1765
,
1764
,
1688
,
1687
,
1686
,
1684
,
1656
,
1341
,
1341
,
/* 270 */
134
1
,
1341
,
1341
,
1341
,
1650
,
1651
,
1649
,
1648
,
1341
,
1341
,
/* 280 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 290 */
134
1
,
1341
,
1341
,
1713
,
1341
,
1777
,
1781
,
1341
,
1341
,
1341
,
/* 300 */
1
634
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 310 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 320 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 330 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 340 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 350 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 360 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 370 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 380 */
134
1
,
1341
,
1341
,
1375
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 390 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 400 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 410 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 420 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1437
,
1436
,
/* 430 */
1
341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 440 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 450 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 460 */
1
736
,
1746
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 470 */
134
1
,
1634
,
1341
,
1763
,
1341
,
1722
,
1718
,
1341
,
1341
,
1714
,
/* 480 */
134
1
,
1341
,
1775
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 490 */
134
1
,
1341
,
1708
,
1341
,
1681
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 500 */
134
1
,
1341
,
1341
,
1644
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 510 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1633
,
1341
,
1672
,
1341
,
/* 520 */
1
341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1500
,
1341
,
1341
,
/* 530 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 540 */
1
485
,
1483
,
1482
,
1481
,
1341
,
1478
,
1341
,
1341
,
1341
,
1341
,
/* 550 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1430
,
1341
,
1341
,
/* 560 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1421
,
1341
,
1420
,
/* 570 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 580 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 590 */
134
1
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
1341
,
/* 600 */
134
1
,
1341
,
1341
,
/* 0 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 10 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 20 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 30 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 40 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 50 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 60 */
134
5
,
1345
,
1414
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 70 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1412
,
1552
,
1345
,
/* 80 */
171
7
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 90 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 100 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1414
,
1345
,
/* 110 */
172
8
,
1728
,
1728
,
1412
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 120 */
150
7
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1590
,
/* 130 */
134
5
,
1345
,
1794
,
1345
,
1596
,
1752
,
1345
,
1345
,
1345
,
1345
,
/* 140 */
1
460
,
1744
,
1720
,
1734
,
1721
,
1779
,
1779
,
1779
,
1737
,
1345
,
/* 150 */
134
5
,
1345
,
1345
,
1582
,
1345
,
1345
,
1557
,
1554
,
1554
,
1345
,
/* 160 */
134
5
,
1345
,
1345
,
1414
,
1345
,
1414
,
1345
,
1414
,
1345
,
1345
,
/* 170 */
141
4
,
1414
,
1345
,
1414
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 180 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 190 */
1
412
,
1592
,
1345
,
1412
,
1345
,
1412
,
1345
,
1345
,
1412
,
1345
,
/* 200 */
175
9
,
1757
,
1345
,
1759
,
1757
,
1345
,
1345
,
1345
,
1771
,
1767
,
/* 210 */
17
50
,
1748
,
1734
,
1345
,
1345
,
1345
,
1785
,
1781
,
1797
,
1785
,
/* 220 */
17
81
,
1785
,
1781
,
1345
,
1757
,
1345
,
1345
,
1757
,
1345
,
1565
,
/* 230 */
134
5
,
1345
,
1412
,
1345
,
1412
,
1345
,
1476
,
1345
,
1345
,
1412
,
/* 240 */
1
345
,
1584
,
1598
,
1574
,
1510
,
1510
,
1510
,
1415
,
1350
,
1345
,
/* 250 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 260 */
1
472
,
1661
,
1770
,
1769
,
1693
,
1692
,
1691
,
1689
,
1660
,
1345
,
/* 270 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1654
,
1655
,
1653
,
1652
,
1345
,
/* 280 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 290 */
134
5
,
1345
,
1345
,
1345
,
1718
,
1345
,
1782
,
1786
,
1345
,
1345
,
/* 300 */
1
345
,
1638
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 310 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 320 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 330 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 340 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 350 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 360 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 370 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 380 */
134
5
,
1345
,
1345
,
1345
,
1379
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 390 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 400 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 410 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 420 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1441
,
/* 430 */
1
440
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 440 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 450 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 460 */
1
345
,
1741
,
1751
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 470 */
134
5
,
1345
,
1345
,
1638
,
1345
,
1768
,
1345
,
1727
,
1723
,
1345
,
/* 480 */
134
5
,
1719
,
1345
,
1345
,
1780
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 490 */
134
5
,
1345
,
1345
,
1345
,
1713
,
1345
,
1686
,
1345
,
1345
,
1345
,
/* 500 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1648
,
1345
,
1345
,
1345
,
1345
,
/* 510 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1637
,
1345
,
/* 520 */
1
677
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1504
,
/* 530 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 540 */
1
345
,
1345
,
1489
,
1487
,
1486
,
1485
,
1345
,
1482
,
1345
,
1345
,
/* 550 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1434
,
/* 560 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1425
,
/* 570 */
134
5
,
1424
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 580 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 590 */
134
5
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
1345
,
/* 600 */
134
5
,
1345
,
1345
,
1345
,
1345
,
};
/********** End of lemon-generated parsing tables *****************************/
...
...
@@ -1835,139 +1835,140 @@ static const char *const yyRuleName[] = {
/* 315 */
"column_reference ::= table_name NK_DOT column_name"
,
/* 316 */
"pseudo_column ::= ROWTS"
,
/* 317 */
"pseudo_column ::= TBNAME"
,
/* 318 */
"pseudo_column ::= QSTARTTS"
,
/* 319 */
"pseudo_column ::= QENDTS"
,
/* 320 */
"pseudo_column ::= WSTARTTS"
,
/* 321 */
"pseudo_column ::= WENDTS"
,
/* 322 */
"pseudo_column ::= WDURATION"
,
/* 323 */
"function_expression ::= function_name NK_LP expression_list NK_RP"
,
/* 324 */
"function_expression ::= star_func NK_LP star_func_para_list NK_RP"
,
/* 325 */
"function_expression ::= CAST NK_LP expression AS type_name NK_RP"
,
/* 326 */
"function_expression ::= literal_func"
,
/* 327 */
"literal_func ::= noarg_func NK_LP NK_RP"
,
/* 328 */
"literal_func ::= NOW"
,
/* 329 */
"noarg_func ::= NOW"
,
/* 330 */
"noarg_func ::= TODAY"
,
/* 331 */
"noarg_func ::= TIMEZONE"
,
/* 332 */
"star_func ::= COUNT"
,
/* 333 */
"star_func ::= FIRST"
,
/* 334 */
"star_func ::= LAST"
,
/* 335 */
"star_func ::= LAST_ROW"
,
/* 336 */
"star_func_para_list ::= NK_STAR"
,
/* 337 */
"star_func_para_list ::= other_para_list"
,
/* 338 */
"other_para_list ::= star_func_para"
,
/* 339 */
"other_para_list ::= other_para_list NK_COMMA star_func_para"
,
/* 340 */
"star_func_para ::= expression"
,
/* 341 */
"star_func_para ::= table_name NK_DOT NK_STAR"
,
/* 342 */
"predicate ::= expression compare_op expression"
,
/* 343 */
"predicate ::= expression BETWEEN expression AND expression"
,
/* 344 */
"predicate ::= expression NOT BETWEEN expression AND expression"
,
/* 345 */
"predicate ::= expression IS NULL"
,
/* 346 */
"predicate ::= expression IS NOT NULL"
,
/* 347 */
"predicate ::= expression in_op in_predicate_value"
,
/* 348 */
"compare_op ::= NK_LT"
,
/* 349 */
"compare_op ::= NK_GT"
,
/* 350 */
"compare_op ::= NK_LE"
,
/* 351 */
"compare_op ::= NK_GE"
,
/* 352 */
"compare_op ::= NK_NE"
,
/* 353 */
"compare_op ::= NK_EQ"
,
/* 354 */
"compare_op ::= LIKE"
,
/* 355 */
"compare_op ::= NOT LIKE"
,
/* 356 */
"compare_op ::= MATCH"
,
/* 357 */
"compare_op ::= NMATCH"
,
/* 358 */
"compare_op ::= CONTAINS"
,
/* 359 */
"in_op ::= IN"
,
/* 360 */
"in_op ::= NOT IN"
,
/* 361 */
"in_predicate_value ::= NK_LP expression_list NK_RP"
,
/* 362 */
"boolean_value_expression ::= boolean_primary"
,
/* 363 */
"boolean_value_expression ::= NOT boolean_primary"
,
/* 364 */
"boolean_value_expression ::= boolean_value_expression OR boolean_value_expression"
,
/* 365 */
"boolean_value_expression ::= boolean_value_expression AND boolean_value_expression"
,
/* 366 */
"boolean_primary ::= predicate"
,
/* 367 */
"boolean_primary ::= NK_LP boolean_value_expression NK_RP"
,
/* 368 */
"common_expression ::= expression"
,
/* 369 */
"common_expression ::= boolean_value_expression"
,
/* 370 */
"from_clause ::= FROM table_reference_list"
,
/* 371 */
"table_reference_list ::= table_reference"
,
/* 372 */
"table_reference_list ::= table_reference_list NK_COMMA table_reference"
,
/* 373 */
"table_reference ::= table_primary"
,
/* 374 */
"table_reference ::= joined_table"
,
/* 375 */
"table_primary ::= table_name alias_opt"
,
/* 376 */
"table_primary ::= db_name NK_DOT table_name alias_opt"
,
/* 377 */
"table_primary ::= subquery alias_opt"
,
/* 378 */
"table_primary ::= parenthesized_joined_table"
,
/* 379 */
"alias_opt ::="
,
/* 380 */
"alias_opt ::= table_alias"
,
/* 381 */
"alias_opt ::= AS table_alias"
,
/* 382 */
"parenthesized_joined_table ::= NK_LP joined_table NK_RP"
,
/* 383 */
"parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP"
,
/* 384 */
"joined_table ::= table_reference join_type JOIN table_reference ON search_condition"
,
/* 385 */
"join_type ::="
,
/* 386 */
"join_type ::= INNER"
,
/* 387 */
"query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt"
,
/* 388 */
"set_quantifier_opt ::="
,
/* 389 */
"set_quantifier_opt ::= DISTINCT"
,
/* 390 */
"set_quantifier_opt ::= ALL"
,
/* 391 */
"select_list ::= NK_STAR"
,
/* 392 */
"select_list ::= select_sublist"
,
/* 393 */
"select_sublist ::= select_item"
,
/* 394 */
"select_sublist ::= select_sublist NK_COMMA select_item"
,
/* 395 */
"select_item ::= common_expression"
,
/* 396 */
"select_item ::= common_expression column_alias"
,
/* 397 */
"select_item ::= common_expression AS column_alias"
,
/* 398 */
"select_item ::= table_name NK_DOT NK_STAR"
,
/* 399 */
"where_clause_opt ::="
,
/* 400 */
"where_clause_opt ::= WHERE search_condition"
,
/* 401 */
"partition_by_clause_opt ::="
,
/* 402 */
"partition_by_clause_opt ::= PARTITION BY expression_list"
,
/* 403 */
"twindow_clause_opt ::="
,
/* 404 */
"twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP"
,
/* 405 */
"twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP"
,
/* 406 */
"twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt"
,
/* 407 */
"twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt"
,
/* 408 */
"sliding_opt ::="
,
/* 409 */
"sliding_opt ::= SLIDING NK_LP duration_literal NK_RP"
,
/* 410 */
"fill_opt ::="
,
/* 411 */
"fill_opt ::= FILL NK_LP fill_mode NK_RP"
,
/* 412 */
"fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP"
,
/* 413 */
"fill_mode ::= NONE"
,
/* 414 */
"fill_mode ::= PREV"
,
/* 415 */
"fill_mode ::= NULL"
,
/* 416 */
"fill_mode ::= LINEAR"
,
/* 417 */
"fill_mode ::= NEXT"
,
/* 418 */
"group_by_clause_opt ::="
,
/* 419 */
"group_by_clause_opt ::= GROUP BY group_by_list"
,
/* 420 */
"group_by_list ::= expression"
,
/* 421 */
"group_by_list ::= group_by_list NK_COMMA expression"
,
/* 422 */
"having_clause_opt ::="
,
/* 423 */
"having_clause_opt ::= HAVING search_condition"
,
/* 424 */
"query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt"
,
/* 425 */
"query_expression_body ::= query_primary"
,
/* 426 */
"query_expression_body ::= query_expression_body UNION ALL query_expression_body"
,
/* 427 */
"query_expression_body ::= query_expression_body UNION query_expression_body"
,
/* 428 */
"query_primary ::= query_specification"
,
/* 429 */
"query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP"
,
/* 430 */
"order_by_clause_opt ::="
,
/* 431 */
"order_by_clause_opt ::= ORDER BY sort_specification_list"
,
/* 432 */
"slimit_clause_opt ::="
,
/* 433 */
"slimit_clause_opt ::= SLIMIT NK_INTEGER"
,
/* 434 */
"slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER"
,
/* 435 */
"slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER"
,
/* 436 */
"limit_clause_opt ::="
,
/* 437 */
"limit_clause_opt ::= LIMIT NK_INTEGER"
,
/* 438 */
"limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER"
,
/* 439 */
"limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER"
,
/* 440 */
"subquery ::= NK_LP query_expression NK_RP"
,
/* 441 */
"search_condition ::= common_expression"
,
/* 442 */
"sort_specification_list ::= sort_specification"
,
/* 443 */
"sort_specification_list ::= sort_specification_list NK_COMMA sort_specification"
,
/* 444 */
"sort_specification ::= expression ordering_specification_opt null_ordering_opt"
,
/* 445 */
"ordering_specification_opt ::="
,
/* 446 */
"ordering_specification_opt ::= ASC"
,
/* 447 */
"ordering_specification_opt ::= DESC"
,
/* 448 */
"null_ordering_opt ::="
,
/* 449 */
"null_ordering_opt ::= NULLS FIRST"
,
/* 450 */
"null_ordering_opt ::= NULLS LAST"
,
/* 318 */
"pseudo_column ::= table_name NK_DOT TBNAME"
,
/* 319 */
"pseudo_column ::= QSTARTTS"
,
/* 320 */
"pseudo_column ::= QENDTS"
,
/* 321 */
"pseudo_column ::= WSTARTTS"
,
/* 322 */
"pseudo_column ::= WENDTS"
,
/* 323 */
"pseudo_column ::= WDURATION"
,
/* 324 */
"function_expression ::= function_name NK_LP expression_list NK_RP"
,
/* 325 */
"function_expression ::= star_func NK_LP star_func_para_list NK_RP"
,
/* 326 */
"function_expression ::= CAST NK_LP expression AS type_name NK_RP"
,
/* 327 */
"function_expression ::= literal_func"
,
/* 328 */
"literal_func ::= noarg_func NK_LP NK_RP"
,
/* 329 */
"literal_func ::= NOW"
,
/* 330 */
"noarg_func ::= NOW"
,
/* 331 */
"noarg_func ::= TODAY"
,
/* 332 */
"noarg_func ::= TIMEZONE"
,
/* 333 */
"star_func ::= COUNT"
,
/* 334 */
"star_func ::= FIRST"
,
/* 335 */
"star_func ::= LAST"
,
/* 336 */
"star_func ::= LAST_ROW"
,
/* 337 */
"star_func_para_list ::= NK_STAR"
,
/* 338 */
"star_func_para_list ::= other_para_list"
,
/* 339 */
"other_para_list ::= star_func_para"
,
/* 340 */
"other_para_list ::= other_para_list NK_COMMA star_func_para"
,
/* 341 */
"star_func_para ::= expression"
,
/* 342 */
"star_func_para ::= table_name NK_DOT NK_STAR"
,
/* 343 */
"predicate ::= expression compare_op expression"
,
/* 344 */
"predicate ::= expression BETWEEN expression AND expression"
,
/* 345 */
"predicate ::= expression NOT BETWEEN expression AND expression"
,
/* 346 */
"predicate ::= expression IS NULL"
,
/* 347 */
"predicate ::= expression IS NOT NULL"
,
/* 348 */
"predicate ::= expression in_op in_predicate_value"
,
/* 349 */
"compare_op ::= NK_LT"
,
/* 350 */
"compare_op ::= NK_GT"
,
/* 351 */
"compare_op ::= NK_LE"
,
/* 352 */
"compare_op ::= NK_GE"
,
/* 353 */
"compare_op ::= NK_NE"
,
/* 354 */
"compare_op ::= NK_EQ"
,
/* 355 */
"compare_op ::= LIKE"
,
/* 356 */
"compare_op ::= NOT LIKE"
,
/* 357 */
"compare_op ::= MATCH"
,
/* 358 */
"compare_op ::= NMATCH"
,
/* 359 */
"compare_op ::= CONTAINS"
,
/* 360 */
"in_op ::= IN"
,
/* 361 */
"in_op ::= NOT IN"
,
/* 362 */
"in_predicate_value ::= NK_LP expression_list NK_RP"
,
/* 363 */
"boolean_value_expression ::= boolean_primary"
,
/* 364 */
"boolean_value_expression ::= NOT boolean_primary"
,
/* 365 */
"boolean_value_expression ::= boolean_value_expression OR boolean_value_expression"
,
/* 366 */
"boolean_value_expression ::= boolean_value_expression AND boolean_value_expression"
,
/* 367 */
"boolean_primary ::= predicate"
,
/* 368 */
"boolean_primary ::= NK_LP boolean_value_expression NK_RP"
,
/* 369 */
"common_expression ::= expression"
,
/* 370 */
"common_expression ::= boolean_value_expression"
,
/* 371 */
"from_clause ::= FROM table_reference_list"
,
/* 372 */
"table_reference_list ::= table_reference"
,
/* 373 */
"table_reference_list ::= table_reference_list NK_COMMA table_reference"
,
/* 374 */
"table_reference ::= table_primary"
,
/* 375 */
"table_reference ::= joined_table"
,
/* 376 */
"table_primary ::= table_name alias_opt"
,
/* 377 */
"table_primary ::= db_name NK_DOT table_name alias_opt"
,
/* 378 */
"table_primary ::= subquery alias_opt"
,
/* 379 */
"table_primary ::= parenthesized_joined_table"
,
/* 380 */
"alias_opt ::="
,
/* 381 */
"alias_opt ::= table_alias"
,
/* 382 */
"alias_opt ::= AS table_alias"
,
/* 383 */
"parenthesized_joined_table ::= NK_LP joined_table NK_RP"
,
/* 384 */
"parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP"
,
/* 385 */
"joined_table ::= table_reference join_type JOIN table_reference ON search_condition"
,
/* 386 */
"join_type ::="
,
/* 387 */
"join_type ::= INNER"
,
/* 388 */
"query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt"
,
/* 389 */
"set_quantifier_opt ::="
,
/* 390 */
"set_quantifier_opt ::= DISTINCT"
,
/* 391 */
"set_quantifier_opt ::= ALL"
,
/* 392 */
"select_list ::= NK_STAR"
,
/* 393 */
"select_list ::= select_sublist"
,
/* 394 */
"select_sublist ::= select_item"
,
/* 395 */
"select_sublist ::= select_sublist NK_COMMA select_item"
,
/* 396 */
"select_item ::= common_expression"
,
/* 397 */
"select_item ::= common_expression column_alias"
,
/* 398 */
"select_item ::= common_expression AS column_alias"
,
/* 399 */
"select_item ::= table_name NK_DOT NK_STAR"
,
/* 400 */
"where_clause_opt ::="
,
/* 401 */
"where_clause_opt ::= WHERE search_condition"
,
/* 402 */
"partition_by_clause_opt ::="
,
/* 403 */
"partition_by_clause_opt ::= PARTITION BY expression_list"
,
/* 404 */
"twindow_clause_opt ::="
,
/* 405 */
"twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP"
,
/* 406 */
"twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP"
,
/* 407 */
"twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt"
,
/* 408 */
"twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt"
,
/* 409 */
"sliding_opt ::="
,
/* 410 */
"sliding_opt ::= SLIDING NK_LP duration_literal NK_RP"
,
/* 411 */
"fill_opt ::="
,
/* 412 */
"fill_opt ::= FILL NK_LP fill_mode NK_RP"
,
/* 413 */
"fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP"
,
/* 414 */
"fill_mode ::= NONE"
,
/* 415 */
"fill_mode ::= PREV"
,
/* 416 */
"fill_mode ::= NULL"
,
/* 417 */
"fill_mode ::= LINEAR"
,
/* 418 */
"fill_mode ::= NEXT"
,
/* 419 */
"group_by_clause_opt ::="
,
/* 420 */
"group_by_clause_opt ::= GROUP BY group_by_list"
,
/* 421 */
"group_by_list ::= expression"
,
/* 422 */
"group_by_list ::= group_by_list NK_COMMA expression"
,
/* 423 */
"having_clause_opt ::="
,
/* 424 */
"having_clause_opt ::= HAVING search_condition"
,
/* 425 */
"query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt"
,
/* 426 */
"query_expression_body ::= query_primary"
,
/* 427 */
"query_expression_body ::= query_expression_body UNION ALL query_expression_body"
,
/* 428 */
"query_expression_body ::= query_expression_body UNION query_expression_body"
,
/* 429 */
"query_primary ::= query_specification"
,
/* 430 */
"query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP"
,
/* 431 */
"order_by_clause_opt ::="
,
/* 432 */
"order_by_clause_opt ::= ORDER BY sort_specification_list"
,
/* 433 */
"slimit_clause_opt ::="
,
/* 434 */
"slimit_clause_opt ::= SLIMIT NK_INTEGER"
,
/* 435 */
"slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER"
,
/* 436 */
"slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER"
,
/* 437 */
"limit_clause_opt ::="
,
/* 438 */
"limit_clause_opt ::= LIMIT NK_INTEGER"
,
/* 439 */
"limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER"
,
/* 440 */
"limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER"
,
/* 441 */
"subquery ::= NK_LP query_expression NK_RP"
,
/* 442 */
"search_condition ::= common_expression"
,
/* 443 */
"sort_specification_list ::= sort_specification"
,
/* 444 */
"sort_specification_list ::= sort_specification_list NK_COMMA sort_specification"
,
/* 445 */
"sort_specification ::= expression ordering_specification_opt null_ordering_opt"
,
/* 446 */
"ordering_specification_opt ::="
,
/* 447 */
"ordering_specification_opt ::= ASC"
,
/* 448 */
"ordering_specification_opt ::= DESC"
,
/* 449 */
"null_ordering_opt ::="
,
/* 450 */
"null_ordering_opt ::= NULLS FIRST"
,
/* 451 */
"null_ordering_opt ::= NULLS LAST"
,
};
#endif
/* NDEBUG */
...
...
@@ -2878,139 +2879,140 @@ static const struct {
{
312
,
-
3
},
/* (315) column_reference ::= table_name NK_DOT column_name */
{
311
,
-
1
},
/* (316) pseudo_column ::= ROWTS */
{
311
,
-
1
},
/* (317) pseudo_column ::= TBNAME */
{
311
,
-
1
},
/* (318) pseudo_column ::= QSTARTTS */
{
311
,
-
1
},
/* (319) pseudo_column ::= QENDTS */
{
311
,
-
1
},
/* (320) pseudo_column ::= WSTARTTS */
{
311
,
-
1
},
/* (321) pseudo_column ::= WENDTS */
{
311
,
-
1
},
/* (322) pseudo_column ::= WDURATION */
{
313
,
-
4
},
/* (323) function_expression ::= function_name NK_LP expression_list NK_RP */
{
313
,
-
4
},
/* (324) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
{
313
,
-
6
},
/* (325) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
{
313
,
-
1
},
/* (326) function_expression ::= literal_func */
{
307
,
-
3
},
/* (327) literal_func ::= noarg_func NK_LP NK_RP */
{
307
,
-
1
},
/* (328) literal_func ::= NOW */
{
317
,
-
1
},
/* (329) noarg_func ::= NOW */
{
317
,
-
1
},
/* (330) noarg_func ::= TODAY */
{
317
,
-
1
},
/* (331) noarg_func ::= TIMEZONE */
{
315
,
-
1
},
/* (332) star_func ::= COUNT */
{
315
,
-
1
},
/* (333) star_func ::= FIRST */
{
315
,
-
1
},
/* (334) star_func ::= LAST */
{
315
,
-
1
},
/* (335) star_func ::= LAST_ROW */
{
316
,
-
1
},
/* (336) star_func_para_list ::= NK_STAR */
{
316
,
-
1
},
/* (337) star_func_para_list ::= other_para_list */
{
318
,
-
1
},
/* (338) other_para_list ::= star_func_para */
{
318
,
-
3
},
/* (339) other_para_list ::= other_para_list NK_COMMA star_func_para */
{
319
,
-
1
},
/* (340) star_func_para ::= expression */
{
319
,
-
3
},
/* (341) star_func_para ::= table_name NK_DOT NK_STAR */
{
320
,
-
3
},
/* (342) predicate ::= expression compare_op expression */
{
320
,
-
5
},
/* (343) predicate ::= expression BETWEEN expression AND expression */
{
320
,
-
6
},
/* (344) predicate ::= expression NOT BETWEEN expression AND expression */
{
320
,
-
3
},
/* (345) predicate ::= expression IS NULL */
{
320
,
-
4
},
/* (346) predicate ::= expression IS NOT NULL */
{
320
,
-
3
},
/* (347) predicate ::= expression in_op in_predicate_value */
{
321
,
-
1
},
/* (348) compare_op ::= NK_LT */
{
321
,
-
1
},
/* (349) compare_op ::= NK_GT */
{
321
,
-
1
},
/* (350) compare_op ::= NK_LE */
{
321
,
-
1
},
/* (351) compare_op ::= NK_GE */
{
321
,
-
1
},
/* (352) compare_op ::= NK_NE */
{
321
,
-
1
},
/* (353) compare_op ::= NK_EQ */
{
321
,
-
1
},
/* (354) compare_op ::= LIKE */
{
321
,
-
2
},
/* (355) compare_op ::= NOT LIKE */
{
321
,
-
1
},
/* (356) compare_op ::= MATCH */
{
321
,
-
1
},
/* (357) compare_op ::= NMATCH */
{
321
,
-
1
},
/* (358) compare_op ::= CONTAINS */
{
322
,
-
1
},
/* (359) in_op ::= IN */
{
322
,
-
2
},
/* (360) in_op ::= NOT IN */
{
323
,
-
3
},
/* (361) in_predicate_value ::= NK_LP expression_list NK_RP */
{
324
,
-
1
},
/* (362) boolean_value_expression ::= boolean_primary */
{
324
,
-
2
},
/* (363) boolean_value_expression ::= NOT boolean_primary */
{
324
,
-
3
},
/* (364) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
324
,
-
3
},
/* (365) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
325
,
-
1
},
/* (366) boolean_primary ::= predicate */
{
325
,
-
3
},
/* (367) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
{
326
,
-
1
},
/* (368) common_expression ::= expression */
{
326
,
-
1
},
/* (369) common_expression ::= boolean_value_expression */
{
327
,
-
2
},
/* (370) from_clause ::= FROM table_reference_list */
{
328
,
-
1
},
/* (371) table_reference_list ::= table_reference */
{
328
,
-
3
},
/* (372) table_reference_list ::= table_reference_list NK_COMMA table_reference */
{
329
,
-
1
},
/* (373) table_reference ::= table_primary */
{
329
,
-
1
},
/* (374) table_reference ::= joined_table */
{
330
,
-
2
},
/* (375) table_primary ::= table_name alias_opt */
{
330
,
-
4
},
/* (376) table_primary ::= db_name NK_DOT table_name alias_opt */
{
330
,
-
2
},
/* (377) table_primary ::= subquery alias_opt */
{
330
,
-
1
},
/* (378) table_primary ::= parenthesized_joined_table */
{
332
,
0
},
/* (379) alias_opt ::= */
{
332
,
-
1
},
/* (380) alias_opt ::= table_alias */
{
332
,
-
2
},
/* (381) alias_opt ::= AS table_alias */
{
333
,
-
3
},
/* (382) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
{
333
,
-
3
},
/* (383) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
{
331
,
-
6
},
/* (384) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{
334
,
0
},
/* (385) join_type ::= */
{
334
,
-
1
},
/* (386) join_type ::= INNER */
{
336
,
-
9
},
/* (387) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
337
,
0
},
/* (388) set_quantifier_opt ::= */
{
337
,
-
1
},
/* (389) set_quantifier_opt ::= DISTINCT */
{
337
,
-
1
},
/* (390) set_quantifier_opt ::= ALL */
{
338
,
-
1
},
/* (391) select_list ::= NK_STAR */
{
338
,
-
1
},
/* (392) select_list ::= select_sublist */
{
344
,
-
1
},
/* (393) select_sublist ::= select_item */
{
344
,
-
3
},
/* (394) select_sublist ::= select_sublist NK_COMMA select_item */
{
345
,
-
1
},
/* (395) select_item ::= common_expression */
{
345
,
-
2
},
/* (396) select_item ::= common_expression column_alias */
{
345
,
-
3
},
/* (397) select_item ::= common_expression AS column_alias */
{
345
,
-
3
},
/* (398) select_item ::= table_name NK_DOT NK_STAR */
{
339
,
0
},
/* (399) where_clause_opt ::= */
{
339
,
-
2
},
/* (400) where_clause_opt ::= WHERE search_condition */
{
340
,
0
},
/* (401) partition_by_clause_opt ::= */
{
340
,
-
3
},
/* (402) partition_by_clause_opt ::= PARTITION BY expression_list */
{
341
,
0
},
/* (403) twindow_clause_opt ::= */
{
341
,
-
6
},
/* (404) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
{
341
,
-
4
},
/* (405) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
{
341
,
-
6
},
/* (406) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{
341
,
-
8
},
/* (407) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{
291
,
0
},
/* (408) sliding_opt ::= */
{
291
,
-
4
},
/* (409) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{
346
,
0
},
/* (410) fill_opt ::= */
{
346
,
-
4
},
/* (411) fill_opt ::= FILL NK_LP fill_mode NK_RP */
{
346
,
-
6
},
/* (412) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{
347
,
-
1
},
/* (413) fill_mode ::= NONE */
{
347
,
-
1
},
/* (414) fill_mode ::= PREV */
{
347
,
-
1
},
/* (415) fill_mode ::= NULL */
{
347
,
-
1
},
/* (416) fill_mode ::= LINEAR */
{
347
,
-
1
},
/* (417) fill_mode ::= NEXT */
{
342
,
0
},
/* (418) group_by_clause_opt ::= */
{
342
,
-
3
},
/* (419) group_by_clause_opt ::= GROUP BY group_by_list */
{
348
,
-
1
},
/* (420) group_by_list ::= expression */
{
348
,
-
3
},
/* (421) group_by_list ::= group_by_list NK_COMMA expression */
{
343
,
0
},
/* (422) having_clause_opt ::= */
{
343
,
-
2
},
/* (423) having_clause_opt ::= HAVING search_condition */
{
296
,
-
4
},
/* (424) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
349
,
-
1
},
/* (425) query_expression_body ::= query_primary */
{
349
,
-
4
},
/* (426) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{
349
,
-
3
},
/* (427) query_expression_body ::= query_expression_body UNION query_expression_body */
{
353
,
-
1
},
/* (428) query_primary ::= query_specification */
{
353
,
-
6
},
/* (429) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
{
350
,
0
},
/* (430) order_by_clause_opt ::= */
{
350
,
-
3
},
/* (431) order_by_clause_opt ::= ORDER BY sort_specification_list */
{
351
,
0
},
/* (432) slimit_clause_opt ::= */
{
351
,
-
2
},
/* (433) slimit_clause_opt ::= SLIMIT NK_INTEGER */
{
351
,
-
4
},
/* (434) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
{
351
,
-
4
},
/* (435) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{
352
,
0
},
/* (436) limit_clause_opt ::= */
{
352
,
-
2
},
/* (437) limit_clause_opt ::= LIMIT NK_INTEGER */
{
352
,
-
4
},
/* (438) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
{
352
,
-
4
},
/* (439) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{
314
,
-
3
},
/* (440) subquery ::= NK_LP query_expression NK_RP */
{
335
,
-
1
},
/* (441) search_condition ::= common_expression */
{
354
,
-
1
},
/* (442) sort_specification_list ::= sort_specification */
{
354
,
-
3
},
/* (443) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
{
355
,
-
3
},
/* (444) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{
356
,
0
},
/* (445) ordering_specification_opt ::= */
{
356
,
-
1
},
/* (446) ordering_specification_opt ::= ASC */
{
356
,
-
1
},
/* (447) ordering_specification_opt ::= DESC */
{
357
,
0
},
/* (448) null_ordering_opt ::= */
{
357
,
-
2
},
/* (449) null_ordering_opt ::= NULLS FIRST */
{
357
,
-
2
},
/* (450) null_ordering_opt ::= NULLS LAST */
{
311
,
-
3
},
/* (318) pseudo_column ::= table_name NK_DOT TBNAME */
{
311
,
-
1
},
/* (319) pseudo_column ::= QSTARTTS */
{
311
,
-
1
},
/* (320) pseudo_column ::= QENDTS */
{
311
,
-
1
},
/* (321) pseudo_column ::= WSTARTTS */
{
311
,
-
1
},
/* (322) pseudo_column ::= WENDTS */
{
311
,
-
1
},
/* (323) pseudo_column ::= WDURATION */
{
313
,
-
4
},
/* (324) function_expression ::= function_name NK_LP expression_list NK_RP */
{
313
,
-
4
},
/* (325) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
{
313
,
-
6
},
/* (326) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
{
313
,
-
1
},
/* (327) function_expression ::= literal_func */
{
307
,
-
3
},
/* (328) literal_func ::= noarg_func NK_LP NK_RP */
{
307
,
-
1
},
/* (329) literal_func ::= NOW */
{
317
,
-
1
},
/* (330) noarg_func ::= NOW */
{
317
,
-
1
},
/* (331) noarg_func ::= TODAY */
{
317
,
-
1
},
/* (332) noarg_func ::= TIMEZONE */
{
315
,
-
1
},
/* (333) star_func ::= COUNT */
{
315
,
-
1
},
/* (334) star_func ::= FIRST */
{
315
,
-
1
},
/* (335) star_func ::= LAST */
{
315
,
-
1
},
/* (336) star_func ::= LAST_ROW */
{
316
,
-
1
},
/* (337) star_func_para_list ::= NK_STAR */
{
316
,
-
1
},
/* (338) star_func_para_list ::= other_para_list */
{
318
,
-
1
},
/* (339) other_para_list ::= star_func_para */
{
318
,
-
3
},
/* (340) other_para_list ::= other_para_list NK_COMMA star_func_para */
{
319
,
-
1
},
/* (341) star_func_para ::= expression */
{
319
,
-
3
},
/* (342) star_func_para ::= table_name NK_DOT NK_STAR */
{
320
,
-
3
},
/* (343) predicate ::= expression compare_op expression */
{
320
,
-
5
},
/* (344) predicate ::= expression BETWEEN expression AND expression */
{
320
,
-
6
},
/* (345) predicate ::= expression NOT BETWEEN expression AND expression */
{
320
,
-
3
},
/* (346) predicate ::= expression IS NULL */
{
320
,
-
4
},
/* (347) predicate ::= expression IS NOT NULL */
{
320
,
-
3
},
/* (348) predicate ::= expression in_op in_predicate_value */
{
321
,
-
1
},
/* (349) compare_op ::= NK_LT */
{
321
,
-
1
},
/* (350) compare_op ::= NK_GT */
{
321
,
-
1
},
/* (351) compare_op ::= NK_LE */
{
321
,
-
1
},
/* (352) compare_op ::= NK_GE */
{
321
,
-
1
},
/* (353) compare_op ::= NK_NE */
{
321
,
-
1
},
/* (354) compare_op ::= NK_EQ */
{
321
,
-
1
},
/* (355) compare_op ::= LIKE */
{
321
,
-
2
},
/* (356) compare_op ::= NOT LIKE */
{
321
,
-
1
},
/* (357) compare_op ::= MATCH */
{
321
,
-
1
},
/* (358) compare_op ::= NMATCH */
{
321
,
-
1
},
/* (359) compare_op ::= CONTAINS */
{
322
,
-
1
},
/* (360) in_op ::= IN */
{
322
,
-
2
},
/* (361) in_op ::= NOT IN */
{
323
,
-
3
},
/* (362) in_predicate_value ::= NK_LP expression_list NK_RP */
{
324
,
-
1
},
/* (363) boolean_value_expression ::= boolean_primary */
{
324
,
-
2
},
/* (364) boolean_value_expression ::= NOT boolean_primary */
{
324
,
-
3
},
/* (365) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
324
,
-
3
},
/* (366) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
325
,
-
1
},
/* (367) boolean_primary ::= predicate */
{
325
,
-
3
},
/* (368) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
{
326
,
-
1
},
/* (369) common_expression ::= expression */
{
326
,
-
1
},
/* (370) common_expression ::= boolean_value_expression */
{
327
,
-
2
},
/* (371) from_clause ::= FROM table_reference_list */
{
328
,
-
1
},
/* (372) table_reference_list ::= table_reference */
{
328
,
-
3
},
/* (373) table_reference_list ::= table_reference_list NK_COMMA table_reference */
{
329
,
-
1
},
/* (374) table_reference ::= table_primary */
{
329
,
-
1
},
/* (375) table_reference ::= joined_table */
{
330
,
-
2
},
/* (376) table_primary ::= table_name alias_opt */
{
330
,
-
4
},
/* (377) table_primary ::= db_name NK_DOT table_name alias_opt */
{
330
,
-
2
},
/* (378) table_primary ::= subquery alias_opt */
{
330
,
-
1
},
/* (379) table_primary ::= parenthesized_joined_table */
{
332
,
0
},
/* (380) alias_opt ::= */
{
332
,
-
1
},
/* (381) alias_opt ::= table_alias */
{
332
,
-
2
},
/* (382) alias_opt ::= AS table_alias */
{
333
,
-
3
},
/* (383) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
{
333
,
-
3
},
/* (384) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
{
331
,
-
6
},
/* (385) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{
334
,
0
},
/* (386) join_type ::= */
{
334
,
-
1
},
/* (387) join_type ::= INNER */
{
336
,
-
9
},
/* (388) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
337
,
0
},
/* (389) set_quantifier_opt ::= */
{
337
,
-
1
},
/* (390) set_quantifier_opt ::= DISTINCT */
{
337
,
-
1
},
/* (391) set_quantifier_opt ::= ALL */
{
338
,
-
1
},
/* (392) select_list ::= NK_STAR */
{
338
,
-
1
},
/* (393) select_list ::= select_sublist */
{
344
,
-
1
},
/* (394) select_sublist ::= select_item */
{
344
,
-
3
},
/* (395) select_sublist ::= select_sublist NK_COMMA select_item */
{
345
,
-
1
},
/* (396) select_item ::= common_expression */
{
345
,
-
2
},
/* (397) select_item ::= common_expression column_alias */
{
345
,
-
3
},
/* (398) select_item ::= common_expression AS column_alias */
{
345
,
-
3
},
/* (399) select_item ::= table_name NK_DOT NK_STAR */
{
339
,
0
},
/* (400) where_clause_opt ::= */
{
339
,
-
2
},
/* (401) where_clause_opt ::= WHERE search_condition */
{
340
,
0
},
/* (402) partition_by_clause_opt ::= */
{
340
,
-
3
},
/* (403) partition_by_clause_opt ::= PARTITION BY expression_list */
{
341
,
0
},
/* (404) twindow_clause_opt ::= */
{
341
,
-
6
},
/* (405) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
{
341
,
-
4
},
/* (406) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
{
341
,
-
6
},
/* (407) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{
341
,
-
8
},
/* (408) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{
291
,
0
},
/* (409) sliding_opt ::= */
{
291
,
-
4
},
/* (410) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{
346
,
0
},
/* (411) fill_opt ::= */
{
346
,
-
4
},
/* (412) fill_opt ::= FILL NK_LP fill_mode NK_RP */
{
346
,
-
6
},
/* (413) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{
347
,
-
1
},
/* (414) fill_mode ::= NONE */
{
347
,
-
1
},
/* (415) fill_mode ::= PREV */
{
347
,
-
1
},
/* (416) fill_mode ::= NULL */
{
347
,
-
1
},
/* (417) fill_mode ::= LINEAR */
{
347
,
-
1
},
/* (418) fill_mode ::= NEXT */
{
342
,
0
},
/* (419) group_by_clause_opt ::= */
{
342
,
-
3
},
/* (420) group_by_clause_opt ::= GROUP BY group_by_list */
{
348
,
-
1
},
/* (421) group_by_list ::= expression */
{
348
,
-
3
},
/* (422) group_by_list ::= group_by_list NK_COMMA expression */
{
343
,
0
},
/* (423) having_clause_opt ::= */
{
343
,
-
2
},
/* (424) having_clause_opt ::= HAVING search_condition */
{
296
,
-
4
},
/* (425) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
349
,
-
1
},
/* (426) query_expression_body ::= query_primary */
{
349
,
-
4
},
/* (427) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{
349
,
-
3
},
/* (428) query_expression_body ::= query_expression_body UNION query_expression_body */
{
353
,
-
1
},
/* (429) query_primary ::= query_specification */
{
353
,
-
6
},
/* (430) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
{
350
,
0
},
/* (431) order_by_clause_opt ::= */
{
350
,
-
3
},
/* (432) order_by_clause_opt ::= ORDER BY sort_specification_list */
{
351
,
0
},
/* (433) slimit_clause_opt ::= */
{
351
,
-
2
},
/* (434) slimit_clause_opt ::= SLIMIT NK_INTEGER */
{
351
,
-
4
},
/* (435) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
{
351
,
-
4
},
/* (436) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{
352
,
0
},
/* (437) limit_clause_opt ::= */
{
352
,
-
2
},
/* (438) limit_clause_opt ::= LIMIT NK_INTEGER */
{
352
,
-
4
},
/* (439) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
{
352
,
-
4
},
/* (440) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{
314
,
-
3
},
/* (441) subquery ::= NK_LP query_expression NK_RP */
{
335
,
-
1
},
/* (442) search_condition ::= common_expression */
{
354
,
-
1
},
/* (443) sort_specification_list ::= sort_specification */
{
354
,
-
3
},
/* (444) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
{
355
,
-
3
},
/* (445) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{
356
,
0
},
/* (446) ordering_specification_opt ::= */
{
356
,
-
1
},
/* (447) ordering_specification_opt ::= ASC */
{
356
,
-
1
},
/* (448) ordering_specification_opt ::= DESC */
{
357
,
0
},
/* (449) null_ordering_opt ::= */
{
357
,
-
2
},
/* (450) null_ordering_opt ::= NULLS FIRST */
{
357
,
-
2
},
/* (451) null_ordering_opt ::= NULLS LAST */
};
static
void
yy_accept
(
yyParser
*
);
/* Forward Declaration */
...
...
@@ -3227,13 +3229,13 @@ static YYACTIONTYPE yy_reduce(
case
295
:
/* index_name ::= NK_ID */
yytestcase
(
yyruleno
==
295
);
case
296
:
/* topic_name ::= NK_ID */
yytestcase
(
yyruleno
==
296
);
case
297
:
/* stream_name ::= NK_ID */
yytestcase
(
yyruleno
==
297
);
case
3
29
:
/* noarg_func ::= NOW */
yytestcase
(
yyruleno
==
329
);
case
33
0
:
/* noarg_func ::= TODAY */
yytestcase
(
yyruleno
==
330
);
case
33
1
:
/* noarg_func ::= TIMEZONE */
yytestcase
(
yyruleno
==
331
);
case
33
2
:
/* star_func ::= COUNT */
yytestcase
(
yyruleno
==
332
);
case
33
3
:
/* star_func ::= FIRST */
yytestcase
(
yyruleno
==
333
);
case
33
4
:
/* star_func ::= LAST */
yytestcase
(
yyruleno
==
334
);
case
33
5
:
/* star_func ::= LAST_ROW */
yytestcase
(
yyruleno
==
335
);
case
3
30
:
/* noarg_func ::= NOW */
yytestcase
(
yyruleno
==
330
);
case
33
1
:
/* noarg_func ::= TODAY */
yytestcase
(
yyruleno
==
331
);
case
33
2
:
/* noarg_func ::= TIMEZONE */
yytestcase
(
yyruleno
==
332
);
case
33
3
:
/* star_func ::= COUNT */
yytestcase
(
yyruleno
==
333
);
case
33
4
:
/* star_func ::= FIRST */
yytestcase
(
yyruleno
==
334
);
case
33
5
:
/* star_func ::= LAST */
yytestcase
(
yyruleno
==
335
);
case
33
6
:
/* star_func ::= LAST_ROW */
yytestcase
(
yyruleno
==
336
);
{
yylhsminor
.
yy105
=
yymsp
[
0
].
minor
.
yy0
;
}
yymsp
[
0
].
minor
.
yy105
=
yylhsminor
.
yy105
;
break
;
...
...
@@ -3286,7 +3288,7 @@ static YYACTIONTYPE yy_reduce(
case
66
:
/* exists_opt ::= */
yytestcase
(
yyruleno
==
66
);
case
234
:
/* analyze_opt ::= */
yytestcase
(
yyruleno
==
234
);
case
242
:
/* agg_func_opt ::= */
yytestcase
(
yyruleno
==
242
);
case
38
8
:
/* set_quantifier_opt ::= */
yytestcase
(
yyruleno
==
388
);
case
38
9
:
/* set_quantifier_opt ::= */
yytestcase
(
yyruleno
==
389
);
{
yymsp
[
1
].
minor
.
yy617
=
false
;
}
break
;
case
65
:
/* exists_opt ::= IF EXISTS */
...
...
@@ -3423,9 +3425,9 @@ static YYACTIONTYPE yy_reduce(
case
211
:
/* func_name_list ::= func_name */
yytestcase
(
yyruleno
==
211
);
case
220
:
/* func_list ::= func */
yytestcase
(
yyruleno
==
220
);
case
286
:
/* literal_list ::= signed_literal */
yytestcase
(
yyruleno
==
286
);
case
33
8
:
/* other_para_list ::= star_func_para */
yytestcase
(
yyruleno
==
338
);
case
39
3
:
/* select_sublist ::= select_item */
yytestcase
(
yyruleno
==
393
);
case
44
2
:
/* sort_specification_list ::= sort_specification */
yytestcase
(
yyruleno
==
442
);
case
33
9
:
/* other_para_list ::= star_func_para */
yytestcase
(
yyruleno
==
339
);
case
39
4
:
/* select_sublist ::= select_item */
yytestcase
(
yyruleno
==
394
);
case
44
3
:
/* sort_specification_list ::= sort_specification */
yytestcase
(
yyruleno
==
443
);
{
yylhsminor
.
yy60
=
createNodeList
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
}
yymsp
[
0
].
minor
.
yy60
=
yylhsminor
.
yy60
;
break
;
...
...
@@ -3435,9 +3437,9 @@ static YYACTIONTYPE yy_reduce(
case
212
:
/* func_name_list ::= func_name_list NK_COMMA func_name */
yytestcase
(
yyruleno
==
212
);
case
221
:
/* func_list ::= func_list NK_COMMA func */
yytestcase
(
yyruleno
==
221
);
case
287
:
/* literal_list ::= literal_list NK_COMMA signed_literal */
yytestcase
(
yyruleno
==
287
);
case
3
39
:
/* other_para_list ::= other_para_list NK_COMMA star_func_para */
yytestcase
(
yyruleno
==
339
);
case
39
4
:
/* select_sublist ::= select_sublist NK_COMMA select_item */
yytestcase
(
yyruleno
==
394
);
case
44
3
:
/* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
yytestcase
(
yyruleno
==
443
);
case
3
40
:
/* other_para_list ::= other_para_list NK_COMMA star_func_para */
yytestcase
(
yyruleno
==
340
);
case
39
5
:
/* select_sublist ::= select_sublist NK_COMMA select_item */
yytestcase
(
yyruleno
==
395
);
case
44
4
:
/* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
yytestcase
(
yyruleno
==
444
);
{
yylhsminor
.
yy60
=
addNodeToList
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy60
,
yymsp
[
0
].
minor
.
yy172
);
}
yymsp
[
-
2
].
minor
.
yy60
=
yylhsminor
.
yy60
;
break
;
...
...
@@ -3518,9 +3520,9 @@ static YYACTIONTYPE yy_reduce(
break
;
case
128
:
/* specific_tags_opt ::= */
case
159
:
/* tags_def_opt ::= */
yytestcase
(
yyruleno
==
159
);
case
40
1
:
/* partition_by_clause_opt ::= */
yytestcase
(
yyruleno
==
401
);
case
41
8
:
/* group_by_clause_opt ::= */
yytestcase
(
yyruleno
==
418
);
case
43
0
:
/* order_by_clause_opt ::= */
yytestcase
(
yyruleno
==
430
);
case
40
2
:
/* partition_by_clause_opt ::= */
yytestcase
(
yyruleno
==
402
);
case
41
9
:
/* group_by_clause_opt ::= */
yytestcase
(
yyruleno
==
419
);
case
43
1
:
/* order_by_clause_opt ::= */
yytestcase
(
yyruleno
==
431
);
{
yymsp
[
1
].
minor
.
yy60
=
NULL
;
}
break
;
case
129
:
/* specific_tags_opt ::= NK_LP col_name_list NK_RP */
...
...
@@ -3610,8 +3612,8 @@ static YYACTIONTYPE yy_reduce(
{
yymsp
[
-
5
].
minor
.
yy248
=
createDataType
(
TSDB_DATA_TYPE_DECIMAL
);
}
break
;
case
160
:
/* tags_def_opt ::= tags_def */
case
33
7
:
/* star_func_para_list ::= other_para_list */
yytestcase
(
yyruleno
==
337
);
case
39
2
:
/* select_list ::= select_sublist */
yytestcase
(
yyruleno
==
392
);
case
33
8
:
/* star_func_para_list ::= other_para_list */
yytestcase
(
yyruleno
==
338
);
case
39
3
:
/* select_list ::= select_sublist */
yytestcase
(
yyruleno
==
393
);
{
yylhsminor
.
yy60
=
yymsp
[
0
].
minor
.
yy60
;
}
yymsp
[
0
].
minor
.
yy60
=
yylhsminor
.
yy60
;
break
;
...
...
@@ -3756,13 +3758,13 @@ static YYACTIONTYPE yy_reduce(
case
206
:
/* like_pattern_opt ::= */
case
217
:
/* index_options ::= */
yytestcase
(
yyruleno
==
217
);
case
248
:
/* into_opt ::= */
yytestcase
(
yyruleno
==
248
);
case
399
:
/* where_clause_opt ::= */
yytestcase
(
yyruleno
==
399
);
case
40
3
:
/* twindow_clause_opt ::= */
yytestcase
(
yyruleno
==
403
);
case
40
8
:
/* sliding_opt ::= */
yytestcase
(
yyruleno
==
408
);
case
41
0
:
/* fill_opt ::= */
yytestcase
(
yyruleno
==
410
);
case
42
2
:
/* having_clause_opt ::= */
yytestcase
(
yyruleno
==
422
);
case
43
2
:
/* slimit_clause_opt ::= */
yytestcase
(
yyruleno
==
432
);
case
43
6
:
/* limit_clause_opt ::= */
yytestcase
(
yyruleno
==
436
);
case
400
:
/* where_clause_opt ::= */
yytestcase
(
yyruleno
==
400
);
case
40
4
:
/* twindow_clause_opt ::= */
yytestcase
(
yyruleno
==
404
);
case
40
9
:
/* sliding_opt ::= */
yytestcase
(
yyruleno
==
409
);
case
41
1
:
/* fill_opt ::= */
yytestcase
(
yyruleno
==
411
);
case
42
3
:
/* having_clause_opt ::= */
yytestcase
(
yyruleno
==
423
);
case
43
3
:
/* slimit_clause_opt ::= */
yytestcase
(
yyruleno
==
433
);
case
43
7
:
/* limit_clause_opt ::= */
yytestcase
(
yyruleno
==
437
);
{
yymsp
[
1
].
minor
.
yy172
=
NULL
;
}
break
;
case
207
:
/* like_pattern_opt ::= LIKE NK_STRING */
...
...
@@ -3834,7 +3836,7 @@ static YYACTIONTYPE yy_reduce(
break
;
case
235
:
/* analyze_opt ::= ANALYZE */
case
243
:
/* agg_func_opt ::= AGGREGATE */
yytestcase
(
yyruleno
==
243
);
case
3
89
:
/* set_quantifier_opt ::= DISTINCT */
yytestcase
(
yyruleno
==
389
);
case
3
90
:
/* set_quantifier_opt ::= DISTINCT */
yytestcase
(
yyruleno
==
390
);
{
yymsp
[
0
].
minor
.
yy617
=
true
;
}
break
;
case
236
:
/* explain_options ::= */
...
...
@@ -3870,9 +3872,9 @@ static YYACTIONTYPE yy_reduce(
{
pCxt
->
pRootNode
=
createDropStreamStmt
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy617
,
&
yymsp
[
0
].
minor
.
yy105
);
}
break
;
case
249
:
/* into_opt ::= INTO full_table_name */
case
37
0
:
/* from_clause ::= FROM table_reference_list */
yytestcase
(
yyruleno
==
370
);
case
40
0
:
/* where_clause_opt ::= WHERE search_condition */
yytestcase
(
yyruleno
==
400
);
case
42
3
:
/* having_clause_opt ::= HAVING search_condition */
yytestcase
(
yyruleno
==
423
);
case
37
1
:
/* from_clause ::= FROM table_reference_list */
yytestcase
(
yyruleno
==
371
);
case
40
1
:
/* where_clause_opt ::= WHERE search_condition */
yytestcase
(
yyruleno
==
401
);
case
42
4
:
/* having_clause_opt ::= HAVING search_condition */
yytestcase
(
yyruleno
==
424
);
{
yymsp
[
-
1
].
minor
.
yy172
=
yymsp
[
0
].
minor
.
yy172
;
}
break
;
case
250
:
/* stream_options ::= */
...
...
@@ -3941,17 +3943,17 @@ static YYACTIONTYPE yy_reduce(
case
300
:
/* expression ::= column_reference */
yytestcase
(
yyruleno
==
300
);
case
301
:
/* expression ::= function_expression */
yytestcase
(
yyruleno
==
301
);
case
302
:
/* expression ::= subquery */
yytestcase
(
yyruleno
==
302
);
case
32
6
:
/* function_expression ::= literal_func */
yytestcase
(
yyruleno
==
326
);
case
36
2
:
/* boolean_value_expression ::= boolean_primary */
yytestcase
(
yyruleno
==
362
);
case
36
6
:
/* boolean_primary ::= predicate */
yytestcase
(
yyruleno
==
366
);
case
36
8
:
/* common_expression ::= expression */
yytestcase
(
yyruleno
==
368
);
case
3
69
:
/* common_expression ::= boolean_value_expression */
yytestcase
(
yyruleno
==
369
);
case
37
1
:
/* table_reference_list ::= table_reference */
yytestcase
(
yyruleno
==
371
);
case
37
3
:
/* table_reference ::= table_primary */
yytestcase
(
yyruleno
==
373
);
case
37
4
:
/* table_reference ::= joined_table */
yytestcase
(
yyruleno
==
374
);
case
37
8
:
/* table_primary ::= parenthesized_joined_table */
yytestcase
(
yyruleno
==
378
);
case
42
5
:
/* query_expression_body ::= query_primary */
yytestcase
(
yyruleno
==
425
);
case
42
8
:
/* query_primary ::= query_specification */
yytestcase
(
yyruleno
==
428
);
case
32
7
:
/* function_expression ::= literal_func */
yytestcase
(
yyruleno
==
327
);
case
36
3
:
/* boolean_value_expression ::= boolean_primary */
yytestcase
(
yyruleno
==
363
);
case
36
7
:
/* boolean_primary ::= predicate */
yytestcase
(
yyruleno
==
367
);
case
36
9
:
/* common_expression ::= expression */
yytestcase
(
yyruleno
==
369
);
case
3
70
:
/* common_expression ::= boolean_value_expression */
yytestcase
(
yyruleno
==
370
);
case
37
2
:
/* table_reference_list ::= table_reference */
yytestcase
(
yyruleno
==
372
);
case
37
4
:
/* table_reference ::= table_primary */
yytestcase
(
yyruleno
==
374
);
case
37
5
:
/* table_reference ::= joined_table */
yytestcase
(
yyruleno
==
375
);
case
37
9
:
/* table_primary ::= parenthesized_joined_table */
yytestcase
(
yyruleno
==
379
);
case
42
6
:
/* query_expression_body ::= query_primary */
yytestcase
(
yyruleno
==
426
);
case
42
9
:
/* query_primary ::= query_specification */
yytestcase
(
yyruleno
==
429
);
{
yylhsminor
.
yy172
=
yymsp
[
0
].
minor
.
yy172
;
}
yymsp
[
0
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
...
...
@@ -4010,9 +4012,9 @@ static YYACTIONTYPE yy_reduce(
break
;
case
283
:
/* signed_literal ::= duration_literal */
case
285
:
/* signed_literal ::= literal_func */
yytestcase
(
yyruleno
==
285
);
case
34
0
:
/* star_func_para ::= expression */
yytestcase
(
yyruleno
==
340
);
case
39
5
:
/* select_item ::= common_expression */
yytestcase
(
yyruleno
==
395
);
case
44
1
:
/* search_condition ::= common_expression */
yytestcase
(
yyruleno
==
441
);
case
34
1
:
/* star_func_para ::= expression */
yytestcase
(
yyruleno
==
341
);
case
39
6
:
/* select_item ::= common_expression */
yytestcase
(
yyruleno
==
396
);
case
44
2
:
/* search_condition ::= common_expression */
yytestcase
(
yyruleno
==
442
);
{
yylhsminor
.
yy172
=
releaseRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
}
yymsp
[
0
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
...
...
@@ -4021,7 +4023,7 @@ static YYACTIONTYPE yy_reduce(
yymsp
[
0
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
303
:
/* expression ::= NK_LP expression NK_RP */
case
36
7
:
/* boolean_primary ::= NK_LP boolean_value_expression NK_RP */
yytestcase
(
yyruleno
==
367
);
case
36
8
:
/* boolean_primary ::= NK_LP boolean_value_expression NK_RP */
yytestcase
(
yyruleno
==
368
);
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy172
));
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
...
...
@@ -4104,39 +4106,43 @@ static YYACTIONTYPE yy_reduce(
break
;
case
316
:
/* pseudo_column ::= ROWTS */
case
317
:
/* pseudo_column ::= TBNAME */
yytestcase
(
yyruleno
==
317
);
case
31
8
:
/* pseudo_column ::= QSTARTTS */
yytestcase
(
yyruleno
==
318
);
case
3
19
:
/* pseudo_column ::= QENDTS */
yytestcase
(
yyruleno
==
319
);
case
32
0
:
/* pseudo_column ::= WSTARTTS */
yytestcase
(
yyruleno
==
320
);
case
32
1
:
/* pseudo_column ::= WENDTS */
yytestcase
(
yyruleno
==
321
);
case
32
2
:
/* pseudo_column ::= WDURATION */
yytestcase
(
yyruleno
==
322
);
case
32
8
:
/* literal_func ::= NOW */
yytestcase
(
yyruleno
==
328
);
case
31
9
:
/* pseudo_column ::= QSTARTTS */
yytestcase
(
yyruleno
==
319
);
case
3
20
:
/* pseudo_column ::= QENDTS */
yytestcase
(
yyruleno
==
320
);
case
32
1
:
/* pseudo_column ::= WSTARTTS */
yytestcase
(
yyruleno
==
321
);
case
32
2
:
/* pseudo_column ::= WENDTS */
yytestcase
(
yyruleno
==
322
);
case
32
3
:
/* pseudo_column ::= WDURATION */
yytestcase
(
yyruleno
==
323
);
case
32
9
:
/* literal_func ::= NOW */
yytestcase
(
yyruleno
==
329
);
{
yylhsminor
.
yy172
=
createRawExprNode
(
pCxt
,
&
yymsp
[
0
].
minor
.
yy0
,
createFunctionNode
(
pCxt
,
&
yymsp
[
0
].
minor
.
yy0
,
NULL
));
}
yymsp
[
0
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
323
:
/* function_expression ::= function_name NK_LP expression_list NK_RP */
case
324
:
/* function_expression ::= star_func NK_LP star_func_para_list NK_RP */
yytestcase
(
yyruleno
==
324
);
case
318
:
/* pseudo_column ::= table_name NK_DOT TBNAME */
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy105
,
&
yymsp
[
0
].
minor
.
yy0
,
createFunctionNode
(
pCxt
,
&
yymsp
[
0
].
minor
.
yy0
,
createNodeList
(
pCxt
,
createValueNode
(
pCxt
,
TSDB_DATA_TYPE_BINARY
,
&
yymsp
[
-
2
].
minor
.
yy105
))));
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
324
:
/* function_expression ::= function_name NK_LP expression_list NK_RP */
case
325
:
/* function_expression ::= star_func NK_LP star_func_para_list NK_RP */
yytestcase
(
yyruleno
==
325
);
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
3
].
minor
.
yy105
,
&
yymsp
[
0
].
minor
.
yy0
,
createFunctionNode
(
pCxt
,
&
yymsp
[
-
3
].
minor
.
yy105
,
yymsp
[
-
1
].
minor
.
yy60
));
}
yymsp
[
-
3
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
32
5
:
/* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
case
32
6
:
/* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
5
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
createCastFunctionNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
),
yymsp
[
-
1
].
minor
.
yy248
));
}
yymsp
[
-
5
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
32
7
:
/* literal_func ::= noarg_func NK_LP NK_RP */
case
32
8
:
/* literal_func ::= noarg_func NK_LP NK_RP */
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy105
,
&
yymsp
[
0
].
minor
.
yy0
,
createFunctionNode
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy105
,
NULL
));
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
33
6
:
/* star_func_para_list ::= NK_STAR */
case
33
7
:
/* star_func_para_list ::= NK_STAR */
{
yylhsminor
.
yy60
=
createNodeList
(
pCxt
,
createColumnNode
(
pCxt
,
NULL
,
&
yymsp
[
0
].
minor
.
yy0
));
}
yymsp
[
0
].
minor
.
yy60
=
yylhsminor
.
yy60
;
break
;
case
34
1
:
/* star_func_para ::= table_name NK_DOT NK_STAR */
case
39
8
:
/* select_item ::= table_name NK_DOT NK_STAR */
yytestcase
(
yyruleno
==
398
);
case
34
2
:
/* star_func_para ::= table_name NK_DOT NK_STAR */
case
39
9
:
/* select_item ::= table_name NK_DOT NK_STAR */
yytestcase
(
yyruleno
==
399
);
{
yylhsminor
.
yy172
=
createColumnNode
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy105
,
&
yymsp
[
0
].
minor
.
yy0
);
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
34
2
:
/* predicate ::= expression compare_op expression */
case
34
7
:
/* predicate ::= expression in_op in_predicate_value */
yytestcase
(
yyruleno
==
347
);
case
34
3
:
/* predicate ::= expression compare_op expression */
case
34
8
:
/* predicate ::= expression in_op in_predicate_value */
yytestcase
(
yyruleno
==
348
);
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
);
SToken
e
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
...
...
@@ -4144,7 +4150,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
34
3
:
/* predicate ::= expression BETWEEN expression AND expression */
case
34
4
:
/* predicate ::= expression BETWEEN expression AND expression */
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
4
].
minor
.
yy172
);
SToken
e
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
...
...
@@ -4152,7 +4158,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp
[
-
4
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
34
4
:
/* predicate ::= expression NOT BETWEEN expression AND expression */
case
34
5
:
/* predicate ::= expression NOT BETWEEN expression AND expression */
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
5
].
minor
.
yy172
);
SToken
e
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
...
...
@@ -4160,71 +4166,71 @@ static YYACTIONTYPE yy_reduce(
}
yymsp
[
-
5
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
34
5
:
/* predicate ::= expression IS NULL */
case
34
6
:
/* predicate ::= expression IS NULL */
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
);
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
s
,
&
yymsp
[
0
].
minor
.
yy0
,
createOperatorNode
(
pCxt
,
OP_TYPE_IS_NULL
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
),
NULL
));
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
34
6
:
/* predicate ::= expression IS NOT NULL */
case
34
7
:
/* predicate ::= expression IS NOT NULL */
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
);
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
s
,
&
yymsp
[
0
].
minor
.
yy0
,
createOperatorNode
(
pCxt
,
OP_TYPE_IS_NOT_NULL
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
),
NULL
));
}
yymsp
[
-
3
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
34
8
:
/* compare_op ::= NK_LT */
case
34
9
:
/* compare_op ::= NK_LT */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_LOWER_THAN
;
}
break
;
case
3
49
:
/* compare_op ::= NK_GT */
case
3
50
:
/* compare_op ::= NK_GT */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_GREATER_THAN
;
}
break
;
case
35
0
:
/* compare_op ::= NK_LE */
case
35
1
:
/* compare_op ::= NK_LE */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_LOWER_EQUAL
;
}
break
;
case
35
1
:
/* compare_op ::= NK_GE */
case
35
2
:
/* compare_op ::= NK_GE */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_GREATER_EQUAL
;
}
break
;
case
35
2
:
/* compare_op ::= NK_NE */
case
35
3
:
/* compare_op ::= NK_NE */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_NOT_EQUAL
;
}
break
;
case
35
3
:
/* compare_op ::= NK_EQ */
case
35
4
:
/* compare_op ::= NK_EQ */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_EQUAL
;
}
break
;
case
35
4
:
/* compare_op ::= LIKE */
case
35
5
:
/* compare_op ::= LIKE */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_LIKE
;
}
break
;
case
35
5
:
/* compare_op ::= NOT LIKE */
case
35
6
:
/* compare_op ::= NOT LIKE */
{
yymsp
[
-
1
].
minor
.
yy572
=
OP_TYPE_NOT_LIKE
;
}
break
;
case
35
6
:
/* compare_op ::= MATCH */
case
35
7
:
/* compare_op ::= MATCH */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_MATCH
;
}
break
;
case
35
7
:
/* compare_op ::= NMATCH */
case
35
8
:
/* compare_op ::= NMATCH */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_NMATCH
;
}
break
;
case
35
8
:
/* compare_op ::= CONTAINS */
case
35
9
:
/* compare_op ::= CONTAINS */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_JSON_CONTAINS
;
}
break
;
case
3
59
:
/* in_op ::= IN */
case
3
60
:
/* in_op ::= IN */
{
yymsp
[
0
].
minor
.
yy572
=
OP_TYPE_IN
;
}
break
;
case
36
0
:
/* in_op ::= NOT IN */
case
36
1
:
/* in_op ::= NOT IN */
{
yymsp
[
-
1
].
minor
.
yy572
=
OP_TYPE_NOT_IN
;
}
break
;
case
36
1
:
/* in_predicate_value ::= NK_LP expression_list NK_RP */
case
36
2
:
/* in_predicate_value ::= NK_LP expression_list NK_RP */
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
createNodeListNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy60
));
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
36
3
:
/* boolean_value_expression ::= NOT boolean_primary */
case
36
4
:
/* boolean_value_expression ::= NOT boolean_primary */
{
SToken
e
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
1
].
minor
.
yy0
,
&
e
,
createLogicConditionNode
(
pCxt
,
LOGIC_COND_TYPE_NOT
,
releaseRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
),
NULL
));
}
yymsp
[
-
1
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
36
4
:
/* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
case
36
5
:
/* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
);
SToken
e
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
...
...
@@ -4232,7 +4238,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
36
5
:
/* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
case
36
6
:
/* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
SToken
s
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
);
SToken
e
=
getTokenFromRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
);
...
...
@@ -4240,47 +4246,47 @@ static YYACTIONTYPE yy_reduce(
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
37
2
:
/* table_reference_list ::= table_reference_list NK_COMMA table_reference */
case
37
3
:
/* table_reference_list ::= table_reference_list NK_COMMA table_reference */
{
yylhsminor
.
yy172
=
createJoinTableNode
(
pCxt
,
JOIN_TYPE_INNER
,
yymsp
[
-
2
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
,
NULL
);
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
37
5
:
/* table_primary ::= table_name alias_opt */
case
37
6
:
/* table_primary ::= table_name alias_opt */
{
yylhsminor
.
yy172
=
createRealTableNode
(
pCxt
,
NULL
,
&
yymsp
[
-
1
].
minor
.
yy105
,
&
yymsp
[
0
].
minor
.
yy105
);
}
yymsp
[
-
1
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
37
6
:
/* table_primary ::= db_name NK_DOT table_name alias_opt */
case
37
7
:
/* table_primary ::= db_name NK_DOT table_name alias_opt */
{
yylhsminor
.
yy172
=
createRealTableNode
(
pCxt
,
&
yymsp
[
-
3
].
minor
.
yy105
,
&
yymsp
[
-
1
].
minor
.
yy105
,
&
yymsp
[
0
].
minor
.
yy105
);
}
yymsp
[
-
3
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
37
7
:
/* table_primary ::= subquery alias_opt */
case
37
8
:
/* table_primary ::= subquery alias_opt */
{
yylhsminor
.
yy172
=
createTempTableNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy172
),
&
yymsp
[
0
].
minor
.
yy105
);
}
yymsp
[
-
1
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
3
79
:
/* alias_opt ::= */
case
3
80
:
/* alias_opt ::= */
{
yymsp
[
1
].
minor
.
yy105
=
nil_token
;
}
break
;
case
38
0
:
/* alias_opt ::= table_alias */
case
38
1
:
/* alias_opt ::= table_alias */
{
yylhsminor
.
yy105
=
yymsp
[
0
].
minor
.
yy105
;
}
yymsp
[
0
].
minor
.
yy105
=
yylhsminor
.
yy105
;
break
;
case
38
1
:
/* alias_opt ::= AS table_alias */
case
38
2
:
/* alias_opt ::= AS table_alias */
{
yymsp
[
-
1
].
minor
.
yy105
=
yymsp
[
0
].
minor
.
yy105
;
}
break
;
case
38
2
:
/* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
case
38
3
:
/* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
yytestcase
(
yyruleno
==
383
);
case
38
3
:
/* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
case
38
4
:
/* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
yytestcase
(
yyruleno
==
384
);
{
yymsp
[
-
2
].
minor
.
yy172
=
yymsp
[
-
1
].
minor
.
yy172
;
}
break
;
case
38
4
:
/* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
case
38
5
:
/* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{
yylhsminor
.
yy172
=
createJoinTableNode
(
pCxt
,
yymsp
[
-
4
].
minor
.
yy636
,
yymsp
[
-
5
].
minor
.
yy172
,
yymsp
[
-
2
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
);
}
yymsp
[
-
5
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
38
5
:
/* join_type ::= */
case
38
6
:
/* join_type ::= */
{
yymsp
[
1
].
minor
.
yy636
=
JOIN_TYPE_INNER
;
}
break
;
case
38
6
:
/* join_type ::= INNER */
case
38
7
:
/* join_type ::= INNER */
{
yymsp
[
0
].
minor
.
yy636
=
JOIN_TYPE_INNER
;
}
break
;
case
38
7
:
/* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
case
38
8
:
/* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
yymsp
[
-
8
].
minor
.
yy172
=
createSelectStmt
(
pCxt
,
yymsp
[
-
7
].
minor
.
yy617
,
yymsp
[
-
6
].
minor
.
yy60
,
yymsp
[
-
5
].
minor
.
yy172
);
yymsp
[
-
8
].
minor
.
yy172
=
addWhereClause
(
pCxt
,
yymsp
[
-
8
].
minor
.
yy172
,
yymsp
[
-
4
].
minor
.
yy172
);
...
...
@@ -4290,70 +4296,70 @@ static YYACTIONTYPE yy_reduce(
yymsp
[
-
8
].
minor
.
yy172
=
addHavingClause
(
pCxt
,
yymsp
[
-
8
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
);
}
break
;
case
39
0
:
/* set_quantifier_opt ::= ALL */
case
39
1
:
/* set_quantifier_opt ::= ALL */
{
yymsp
[
0
].
minor
.
yy617
=
false
;
}
break
;
case
39
1
:
/* select_list ::= NK_STAR */
case
39
2
:
/* select_list ::= NK_STAR */
{
yymsp
[
0
].
minor
.
yy60
=
NULL
;
}
break
;
case
39
6
:
/* select_item ::= common_expression column_alias */
case
39
7
:
/* select_item ::= common_expression column_alias */
{
yylhsminor
.
yy172
=
setProjectionAlias
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy172
),
&
yymsp
[
0
].
minor
.
yy105
);
}
yymsp
[
-
1
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
39
7
:
/* select_item ::= common_expression AS column_alias */
case
39
8
:
/* select_item ::= common_expression AS column_alias */
{
yylhsminor
.
yy172
=
setProjectionAlias
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
),
&
yymsp
[
0
].
minor
.
yy105
);
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
40
2
:
/* partition_by_clause_opt ::= PARTITION BY expression_list */
case
4
19
:
/* group_by_clause_opt ::= GROUP BY group_by_list */
yytestcase
(
yyruleno
==
419
);
case
43
1
:
/* order_by_clause_opt ::= ORDER BY sort_specification_list */
yytestcase
(
yyruleno
==
431
);
case
40
3
:
/* partition_by_clause_opt ::= PARTITION BY expression_list */
case
4
20
:
/* group_by_clause_opt ::= GROUP BY group_by_list */
yytestcase
(
yyruleno
==
420
);
case
43
2
:
/* order_by_clause_opt ::= ORDER BY sort_specification_list */
yytestcase
(
yyruleno
==
432
);
{
yymsp
[
-
2
].
minor
.
yy60
=
yymsp
[
0
].
minor
.
yy60
;
}
break
;
case
40
4
:
/* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
case
40
5
:
/* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
{
yymsp
[
-
5
].
minor
.
yy172
=
createSessionWindowNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
),
releaseRawExprNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy172
));
}
break
;
case
40
5
:
/* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
case
40
6
:
/* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
{
yymsp
[
-
3
].
minor
.
yy172
=
createStateWindowNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy172
));
}
break
;
case
40
6
:
/* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
case
40
7
:
/* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{
yymsp
[
-
5
].
minor
.
yy172
=
createIntervalWindowNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
),
NULL
,
yymsp
[
-
1
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
);
}
break
;
case
40
7
:
/* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
case
40
8
:
/* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{
yymsp
[
-
7
].
minor
.
yy172
=
createIntervalWindowNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
5
].
minor
.
yy172
),
releaseRawExprNode
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
),
yymsp
[
-
1
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
);
}
break
;
case
4
09
:
/* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
case
4
10
:
/* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{
yymsp
[
-
3
].
minor
.
yy172
=
releaseRawExprNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy172
);
}
break
;
case
41
1
:
/* fill_opt ::= FILL NK_LP fill_mode NK_RP */
case
41
2
:
/* fill_opt ::= FILL NK_LP fill_mode NK_RP */
{
yymsp
[
-
3
].
minor
.
yy172
=
createFillNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy202
,
NULL
);
}
break
;
case
41
2
:
/* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
case
41
3
:
/* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{
yymsp
[
-
5
].
minor
.
yy172
=
createFillNode
(
pCxt
,
FILL_MODE_VALUE
,
createNodeListNode
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy60
));
}
break
;
case
41
3
:
/* fill_mode ::= NONE */
case
41
4
:
/* fill_mode ::= NONE */
{
yymsp
[
0
].
minor
.
yy202
=
FILL_MODE_NONE
;
}
break
;
case
41
4
:
/* fill_mode ::= PREV */
case
41
5
:
/* fill_mode ::= PREV */
{
yymsp
[
0
].
minor
.
yy202
=
FILL_MODE_PREV
;
}
break
;
case
41
5
:
/* fill_mode ::= NULL */
case
41
6
:
/* fill_mode ::= NULL */
{
yymsp
[
0
].
minor
.
yy202
=
FILL_MODE_NULL
;
}
break
;
case
41
6
:
/* fill_mode ::= LINEAR */
case
41
7
:
/* fill_mode ::= LINEAR */
{
yymsp
[
0
].
minor
.
yy202
=
FILL_MODE_LINEAR
;
}
break
;
case
41
7
:
/* fill_mode ::= NEXT */
case
41
8
:
/* fill_mode ::= NEXT */
{
yymsp
[
0
].
minor
.
yy202
=
FILL_MODE_NEXT
;
}
break
;
case
42
0
:
/* group_by_list ::= expression */
case
42
1
:
/* group_by_list ::= expression */
{
yylhsminor
.
yy60
=
createNodeList
(
pCxt
,
createGroupingSetNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
)));
}
yymsp
[
0
].
minor
.
yy60
=
yylhsminor
.
yy60
;
break
;
case
42
1
:
/* group_by_list ::= group_by_list NK_COMMA expression */
case
42
2
:
/* group_by_list ::= group_by_list NK_COMMA expression */
{
yylhsminor
.
yy60
=
addNodeToList
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy60
,
createGroupingSetNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
0
].
minor
.
yy172
)));
}
yymsp
[
-
2
].
minor
.
yy60
=
yylhsminor
.
yy60
;
break
;
case
42
4
:
/* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
case
42
5
:
/* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
yylhsminor
.
yy172
=
addOrderByClause
(
pCxt
,
yymsp
[
-
3
].
minor
.
yy172
,
yymsp
[
-
2
].
minor
.
yy60
);
yylhsminor
.
yy172
=
addSlimitClause
(
pCxt
,
yylhsminor
.
yy172
,
yymsp
[
-
1
].
minor
.
yy172
);
...
...
@@ -4361,56 +4367,56 @@ static YYACTIONTYPE yy_reduce(
}
yymsp
[
-
3
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
42
6
:
/* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
case
42
7
:
/* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{
yylhsminor
.
yy172
=
createSetOperator
(
pCxt
,
SET_OP_TYPE_UNION_ALL
,
yymsp
[
-
3
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
);
}
yymsp
[
-
3
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
42
7
:
/* query_expression_body ::= query_expression_body UNION query_expression_body */
case
42
8
:
/* query_expression_body ::= query_expression_body UNION query_expression_body */
{
yylhsminor
.
yy172
=
createSetOperator
(
pCxt
,
SET_OP_TYPE_UNION
,
yymsp
[
-
2
].
minor
.
yy172
,
yymsp
[
0
].
minor
.
yy172
);
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
4
29
:
/* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
case
4
30
:
/* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */
{
yymsp
[
-
5
].
minor
.
yy172
=
yymsp
[
-
4
].
minor
.
yy172
;
}
yy_destructor
(
yypParser
,
350
,
&
yymsp
[
-
3
].
minor
);
yy_destructor
(
yypParser
,
351
,
&
yymsp
[
-
2
].
minor
);
yy_destructor
(
yypParser
,
352
,
&
yymsp
[
-
1
].
minor
);
break
;
case
43
3
:
/* slimit_clause_opt ::= SLIMIT NK_INTEGER */
case
43
7
:
/* limit_clause_opt ::= LIMIT NK_INTEGER */
yytestcase
(
yyruleno
==
437
);
case
43
4
:
/* slimit_clause_opt ::= SLIMIT NK_INTEGER */
case
43
8
:
/* limit_clause_opt ::= LIMIT NK_INTEGER */
yytestcase
(
yyruleno
==
438
);
{
yymsp
[
-
1
].
minor
.
yy172
=
createLimitNode
(
pCxt
,
&
yymsp
[
0
].
minor
.
yy0
,
NULL
);
}
break
;
case
43
4
:
/* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
case
43
8
:
/* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
yytestcase
(
yyruleno
==
438
);
case
43
5
:
/* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
case
43
9
:
/* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
yytestcase
(
yyruleno
==
439
);
{
yymsp
[
-
3
].
minor
.
yy172
=
createLimitNode
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
);
}
break
;
case
43
5
:
/* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
case
4
39
:
/* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
yytestcase
(
yyruleno
==
439
);
case
43
6
:
/* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
case
4
40
:
/* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
yytestcase
(
yyruleno
==
440
);
{
yymsp
[
-
3
].
minor
.
yy172
=
createLimitNode
(
pCxt
,
&
yymsp
[
0
].
minor
.
yy0
,
&
yymsp
[
-
2
].
minor
.
yy0
);
}
break
;
case
44
0
:
/* subquery ::= NK_LP query_expression NK_RP */
case
44
1
:
/* subquery ::= NK_LP query_expression NK_RP */
{
yylhsminor
.
yy172
=
createRawExprNodeExt
(
pCxt
,
&
yymsp
[
-
2
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
1
].
minor
.
yy172
);
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
44
4
:
/* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
case
44
5
:
/* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{
yylhsminor
.
yy172
=
createOrderByExprNode
(
pCxt
,
releaseRawExprNode
(
pCxt
,
yymsp
[
-
2
].
minor
.
yy172
),
yymsp
[
-
1
].
minor
.
yy14
,
yymsp
[
0
].
minor
.
yy17
);
}
yymsp
[
-
2
].
minor
.
yy172
=
yylhsminor
.
yy172
;
break
;
case
44
5
:
/* ordering_specification_opt ::= */
case
44
6
:
/* ordering_specification_opt ::= */
{
yymsp
[
1
].
minor
.
yy14
=
ORDER_ASC
;
}
break
;
case
44
6
:
/* ordering_specification_opt ::= ASC */
case
44
7
:
/* ordering_specification_opt ::= ASC */
{
yymsp
[
0
].
minor
.
yy14
=
ORDER_ASC
;
}
break
;
case
44
7
:
/* ordering_specification_opt ::= DESC */
case
44
8
:
/* ordering_specification_opt ::= DESC */
{
yymsp
[
0
].
minor
.
yy14
=
ORDER_DESC
;
}
break
;
case
44
8
:
/* null_ordering_opt ::= */
case
44
9
:
/* null_ordering_opt ::= */
{
yymsp
[
1
].
minor
.
yy17
=
NULL_ORDER_DEFAULT
;
}
break
;
case
4
49
:
/* null_ordering_opt ::= NULLS FIRST */
case
4
50
:
/* null_ordering_opt ::= NULLS FIRST */
{
yymsp
[
-
1
].
minor
.
yy17
=
NULL_ORDER_FIRST
;
}
break
;
case
45
0
:
/* null_ordering_opt ::= NULLS LAST */
case
45
1
:
/* null_ordering_opt ::= NULLS LAST */
{
yymsp
[
-
1
].
minor
.
yy17
=
NULL_ORDER_LAST
;
}
break
;
default:
...
...
source/libs/parser/test/parSelectTest.cpp
浏览文件 @
aa2faab1
...
...
@@ -70,6 +70,12 @@ TEST_F(ParserSelectTest, pseudoColumn) {
run
(
"SELECT _WSTARTTS, _WENDTS, COUNT(*) FROM t1 INTERVAL(10s)"
);
}
TEST_F
(
ParserSelectTest
,
pseudoColumnSemanticCheck
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT TBNAME FROM (SELECT * FROM st1s1)"
,
TSDB_CODE_PAR_INVALID_TBNAME
,
PARSER_STAGE_TRANSLATE
);
}
TEST_F
(
ParserSelectTest
,
multiResFunc
)
{
useDb
(
"root"
,
"test"
);
...
...
source/libs/planner/inc/planInt.h
浏览文件 @
aa2faab1
...
...
@@ -32,6 +32,7 @@ extern "C" {
#define planWarn(param, ...) qWarn("PLAN: " param, __VA_ARGS__)
#define planInfo(param, ...) qInfo("PLAN: " param, __VA_ARGS__)
#define planDebug(param, ...) qDebug("PLAN: " param, __VA_ARGS__)
#define planDebugL(param, ...) qDebugL("PLAN: " param, __VA_ARGS__)
#define planTrace(param, ...) qTrace("PLAN: " param, __VA_ARGS__)
int32_t
generateUsageErrMsg
(
char
*
pBuf
,
int32_t
len
,
int32_t
errCode
,
...);
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
aa2faab1
...
...
@@ -310,12 +310,7 @@ static int32_t createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect
static
int32_t
createSubqueryLogicNode
(
SLogicPlanContext
*
pCxt
,
SSelectStmt
*
pSelect
,
STempTableNode
*
pTable
,
SLogicNode
**
pLogicNode
)
{
int32_t
code
=
createQueryLogicNode
(
pCxt
,
pTable
->
pSubquery
,
pLogicNode
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SNode
*
pNode
;
FOREACH
(
pNode
,
(
*
pLogicNode
)
->
pTargets
)
{
strcpy
(((
SColumnNode
*
)
pNode
)
->
tableAlias
,
pTable
->
table
.
tableAlias
);
}
}
return
code
;
return
createQueryLogicNode
(
pCxt
,
pTable
->
pSubquery
,
pLogicNode
);
}
static
int32_t
createJoinLogicNode
(
SLogicPlanContext
*
pCxt
,
SSelectStmt
*
pSelect
,
SJoinTableNode
*
pJoinTable
,
...
...
@@ -879,7 +874,8 @@ static int32_t createSetOpProjectLogicNode(SLogicPlanContext* pCxt, SSetOperator
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
createColumnByProjections
(
pCxt
,
NULL
,
pSetOperator
->
pProjectionList
,
&
pProject
->
node
.
pTargets
);
code
=
createColumnByProjections
(
pCxt
,
pSetOperator
->
stmtName
,
pSetOperator
->
pProjectionList
,
&
pProject
->
node
.
pTargets
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
@@ -933,7 +929,7 @@ static int32_t createSetOpLogicNode(SLogicPlanContext* pCxt, SSetOperator* pSetO
code
=
createSetOpAggLogicNode
(
pCxt
,
pSetOperator
,
&
pSetOp
);
break
;
default:
code
=
-
1
;
code
=
TSDB_CODE_FAILED
;
break
;
}
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
aa2faab1
...
...
@@ -598,39 +598,63 @@ static bool cpdIsPrimaryKeyEqualCond(SJoinLogicNode* pJoin, SNode* pCond) {
return
false
;
}
static
int32_t
cpdCheckOpCond
(
SOptimizeContext
*
pCxt
,
SJoinLogicNode
*
pJoin
,
SNode
*
pOnCond
)
{
if
(
!
cpdIsPrimaryKeyEqualCond
(
pJoin
,
pOnCond
))
{
return
generateUsageErrMsg
(
pCxt
->
pPlanCxt
->
pMsg
,
pCxt
->
pPlanCxt
->
msgLen
,
TSDB_CODE_PLAN_EXPECTED_TS_EQUAL
);
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
cpdCheckLogicCond
(
SOptimizeContext
*
pCxt
,
SJoinLogicNode
*
pJoin
,
SLogicConditionNode
*
pOnCond
)
{
if
(
LOGIC_COND_TYPE_AND
!=
pOnCond
->
condType
)
{
return
generateUsageErrMsg
(
pCxt
->
pPlanCxt
->
pMsg
,
pCxt
->
pPlanCxt
->
msgLen
,
TSDB_CODE_PLAN_EXPECTED_TS_EQUAL
);
static
bool
cpdContainPrimaryKeyEqualCond
(
SJoinLogicNode
*
pJoin
,
SNode
*
pCond
)
{
if
(
QUERY_NODE_LOGIC_CONDITION
==
nodeType
(
pCond
))
{
SLogicConditionNode
*
pLogicCond
=
(
SLogicConditionNode
*
)
pCond
;
if
(
LOGIC_COND_TYPE_AND
!=
pLogicCond
->
condType
)
{
return
false
;
}
bool
hasPrimaryKeyEqualCond
=
false
;
SNode
*
pCond
=
NULL
;
FOREACH
(
pCond
,
pOn
Cond
->
pParameterList
)
{
if
(
cpdIs
PrimaryKeyEqualCond
(
pJoin
,
pCond
))
{
FOREACH
(
pCond
,
pLogic
Cond
->
pParameterList
)
{
if
(
cpdContain
PrimaryKeyEqualCond
(
pJoin
,
pCond
))
{
hasPrimaryKeyEqualCond
=
true
;
break
;
}
}
if
(
!
hasPrimaryKeyEqualCond
)
{
return
generateUsageErrMsg
(
pCxt
->
pPlanCxt
->
pMsg
,
pCxt
->
pPlanCxt
->
msgLen
,
TSDB_CODE_PLAN_EXPECTED_TS_EQUAL
);
}
return
TSDB_CODE_SUCCESS
;
}
return
hasPrimaryKeyEqualCond
;
}
else
{
return
cpdIsPrimaryKeyEqualCond
(
pJoin
,
pCond
);
}
}
// static int32_t cpdCheckOpCond(SOptimizeContext* pCxt, SJoinLogicNode* pJoin, SNode* pOnCond) {
// if (!cpdIsPrimaryKeyEqualCond(pJoin, pOnCond)) {
// return generateUsageErrMsg(pCxt->pPlanCxt->pMsg, pCxt->pPlanCxt->msgLen, TSDB_CODE_PLAN_EXPECTED_TS_EQUAL);
// }
// return TSDB_CODE_SUCCESS;
// }
// static int32_t cpdCheckLogicCond(SOptimizeContext* pCxt, SJoinLogicNode* pJoin, SLogicConditionNode* pOnCond) {
// if (LOGIC_COND_TYPE_AND != pOnCond->condType) {
// return generateUsageErrMsg(pCxt->pPlanCxt->pMsg, pCxt->pPlanCxt->msgLen, TSDB_CODE_PLAN_EXPECTED_TS_EQUAL);
// }
// bool hasPrimaryKeyEqualCond = false;
// SNode* pCond = NULL;
// FOREACH(pCond, pOnCond->pParameterList) {
// if (cpdIsPrimaryKeyEqualCond(pJoin, pCond)) {
// hasPrimaryKeyEqualCond = true;
// }
// }
// if (!hasPrimaryKeyEqualCond) {
// return generateUsageErrMsg(pCxt->pPlanCxt->pMsg, pCxt->pPlanCxt->msgLen, TSDB_CODE_PLAN_EXPECTED_TS_EQUAL);
// }
// return TSDB_CODE_SUCCESS;
// }
static
int32_t
cpdCheckJoinOnCond
(
SOptimizeContext
*
pCxt
,
SJoinLogicNode
*
pJoin
)
{
if
(
NULL
==
pJoin
->
pOnConditions
)
{
return
generateUsageErrMsg
(
pCxt
->
pPlanCxt
->
pMsg
,
pCxt
->
pPlanCxt
->
msgLen
,
TSDB_CODE_PLAN_NOT_SUPPORT_CROSS_JOIN
);
}
if
(
QUERY_NODE_LOGIC_CONDITION
==
nodeType
(
pJoin
->
pOnConditions
))
{
return
cpdCheckLogicCond
(
pCxt
,
pJoin
,
(
SLogicConditionNode
*
)
pJoin
->
pOnConditions
);
}
else
{
return
cpdCheckOpCond
(
pCxt
,
pJoin
,
pJoin
->
pOnConditions
);
if
(
!
cpdContainPrimaryKeyEqualCond
(
pJoin
,
pJoin
->
pOnConditions
))
{
return
generateUsageErrMsg
(
pCxt
->
pPlanCxt
->
pMsg
,
pCxt
->
pPlanCxt
->
msgLen
,
TSDB_CODE_PLAN_EXPECTED_TS_EQUAL
);
}
return
TSDB_CODE_SUCCESS
;
// if (QUERY_NODE_LOGIC_CONDITION == nodeType(pJoin->pOnConditions)) {
// return cpdCheckLogicCond(pCxt, pJoin, (SLogicConditionNode*)pJoin->pOnConditions);
// } else {
// return cpdCheckOpCond(pCxt, pJoin, pJoin->pOnConditions);
// }
}
static
int32_t
cpdPushJoinCondition
(
SOptimizeContext
*
pCxt
,
SJoinLogicNode
*
pJoin
)
{
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
aa2faab1
...
...
@@ -204,6 +204,75 @@ static int32_t ctjSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) {
return
code
;
}
static
bool
unionIsChildSubplan
(
SLogicNode
*
pLogicNode
,
int32_t
groupId
)
{
if
(
QUERY_NODE_LOGIC_PLAN_EXCHANGE
==
nodeType
(
pLogicNode
))
{
return
((
SExchangeLogicNode
*
)
pLogicNode
)
->
srcGroupId
==
groupId
;
}
SNode
*
pChild
;
FOREACH
(
pChild
,
pLogicNode
->
pChildren
)
{
bool
isChild
=
unionIsChildSubplan
((
SLogicNode
*
)
pChild
,
groupId
);
if
(
isChild
)
{
return
isChild
;
}
}
return
false
;
}
static
int32_t
unionMountSubplan
(
SLogicSubplan
*
pParent
,
SNodeList
*
pChildren
)
{
SNode
*
pChild
=
NULL
;
WHERE_EACH
(
pChild
,
pChildren
)
{
if
(
unionIsChildSubplan
(
pParent
->
pNode
,
((
SLogicSubplan
*
)
pChild
)
->
id
.
groupId
))
{
int32_t
code
=
nodesListMakeAppend
(
&
pParent
->
pChildren
,
pChild
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
REPLACE_NODE
(
NULL
);
ERASE_NODE
(
pChildren
);
continue
;
}
else
{
return
code
;
}
}
WHERE_NEXT
;
}
return
TSDB_CODE_SUCCESS
;
}
static
SLogicSubplan
*
unionCreateSubplan
(
SSplitContext
*
pCxt
,
SLogicNode
*
pNode
)
{
SLogicSubplan
*
pSubplan
=
nodesMakeNode
(
QUERY_NODE_LOGIC_SUBPLAN
);
if
(
NULL
==
pSubplan
)
{
return
NULL
;
}
pSubplan
->
id
.
groupId
=
pCxt
->
groupId
;
pSubplan
->
subplanType
=
SUBPLAN_TYPE_SCAN
;
pSubplan
->
pNode
=
pNode
;
return
pSubplan
;
}
static
int32_t
unionSplitSubplan
(
SSplitContext
*
pCxt
,
SLogicSubplan
*
pUnionSubplan
,
SLogicNode
*
pSplitNode
)
{
SNodeList
*
pSubplanChildren
=
pUnionSubplan
->
pChildren
;
pUnionSubplan
->
pChildren
=
NULL
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
SNode
*
pChild
=
NULL
;
FOREACH
(
pChild
,
pSplitNode
->
pChildren
)
{
SLogicSubplan
*
pNewSubplan
=
unionCreateSubplan
(
pCxt
,
(
SLogicNode
*
)
pChild
);
code
=
nodesListMakeStrictAppend
(
&
pUnionSubplan
->
pChildren
,
pNewSubplan
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
REPLACE_NODE
(
NULL
);
code
=
unionMountSubplan
(
pNewSubplan
,
pSubplanChildren
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
break
;
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
nodesDestroyList
(
pSubplanChildren
);
DESTORY_LIST
(
pSplitNode
->
pChildren
);
}
return
code
;
}
static
SLogicNode
*
uaMatchByNode
(
SLogicNode
*
pNode
)
{
if
(
QUERY_NODE_LOGIC_PLAN_PROJECT
==
nodeType
(
pNode
)
&&
LIST_LENGTH
(
pNode
->
pChildren
)
>
1
)
{
return
pNode
;
...
...
@@ -227,17 +296,6 @@ static bool uaFindSplitNode(SLogicSubplan* pSubplan, SUaInfo* pInfo) {
return
NULL
!=
pSplitNode
;
}
static
SLogicSubplan
*
uaCreateSubplan
(
SSplitContext
*
pCxt
,
SLogicNode
*
pNode
)
{
SLogicSubplan
*
pSubplan
=
nodesMakeNode
(
QUERY_NODE_LOGIC_SUBPLAN
);
if
(
NULL
==
pSubplan
)
{
return
NULL
;
}
pSubplan
->
id
.
groupId
=
pCxt
->
groupId
;
pSubplan
->
subplanType
=
SUBPLAN_TYPE_SCAN
;
pSubplan
->
pNode
=
pNode
;
return
pSubplan
;
}
static
int32_t
uaCreateExchangeNode
(
SSplitContext
*
pCxt
,
SLogicSubplan
*
pSubplan
,
SProjectLogicNode
*
pProject
)
{
SExchangeLogicNode
*
pExchange
=
nodesMakeNode
(
QUERY_NODE_LOGIC_PLAN_EXCHANGE
);
if
(
NULL
==
pExchange
)
{
...
...
@@ -276,20 +334,8 @@ static int32_t uaSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
SNode
*
pChild
=
NULL
;
FOREACH
(
pChild
,
info
.
pProject
->
node
.
pChildren
)
{
code
=
nodesListMakeStrictAppend
(
&
info
.
pSubplan
->
pChildren
,
uaCreateSubplan
(
pCxt
,
(
SLogicNode
*
)
pChild
));
if
(
TSDB_CODE_SUCCESS
==
code
)
{
REPLACE_NODE
(
NULL
);
}
else
{
break
;
}
}
int32_t
code
=
unionSplitSubplan
(
pCxt
,
info
.
pSubplan
,
(
SLogicNode
*
)
info
.
pProject
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
nodesClearList
(
info
.
pProject
->
node
.
pChildren
);
info
.
pProject
->
node
.
pChildren
=
NULL
;
code
=
uaCreateExchangeNode
(
pCxt
,
info
.
pSubplan
,
info
.
pProject
);
}
++
(
pCxt
->
groupId
);
...
...
@@ -343,20 +389,8 @@ static int32_t unSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
SNode
*
pChild
=
NULL
;
FOREACH
(
pChild
,
info
.
pAgg
->
node
.
pChildren
)
{
code
=
nodesListMakeStrictAppend
(
&
info
.
pSubplan
->
pChildren
,
uaCreateSubplan
(
pCxt
,
(
SLogicNode
*
)
pChild
));
if
(
TSDB_CODE_SUCCESS
==
code
)
{
REPLACE_NODE
(
NULL
);
}
else
{
break
;
}
}
int32_t
code
=
unionSplitSubplan
(
pCxt
,
info
.
pSubplan
,
(
SLogicNode
*
)
info
.
pAgg
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
nodesClearList
(
info
.
pAgg
->
node
.
pChildren
);
info
.
pAgg
->
node
.
pChildren
=
NULL
;
code
=
unCreateExchangeNode
(
pCxt
,
info
.
pSubplan
,
info
.
pAgg
);
}
++
(
pCxt
->
groupId
);
...
...
source/libs/planner/test/planJoinTest.cpp
浏览文件 @
aa2faab1
...
...
@@ -30,6 +30,14 @@ TEST_F(PlanJoinTest, basic) {
run
(
"SELECT t1.c1, t2.c1 FROM st1s1 t1 JOIN st1s2 t2 ON t1.ts = t2.ts"
);
}
TEST_F
(
PlanJoinTest
,
complex
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT t1.c1, t2.c2 FROM st1s1 t1, st1s2 t2 "
"WHERE t1.ts = t2.ts AND t1.c1 BETWEEN -10 AND 10 AND t2.c1 BETWEEN -100 AND 100 AND "
"(t1.c2 LIKE 'nchar%' OR t1.c1 = 0 OR t2.c2 LIKE 'nchar%' OR t2.c1 = 0)"
);
}
TEST_F
(
PlanJoinTest
,
withWhere
)
{
useDb
(
"root"
,
"test"
);
...
...
source/libs/planner/test/planSetOpTest.cpp
浏览文件 @
aa2faab1
...
...
@@ -23,11 +23,33 @@ class PlanSetOpTest : public PlannerTestBase {};
TEST_F
(
PlanSetOpTest
,
unionAll
)
{
useDb
(
"root"
,
"test"
);
run
(
"select c1, c2 from t1 where c1 > 10 union all select c1, c2 from t1 where c1 > 20"
);
run
(
"SELECT c1, c2 FROM t1 WHERE c1 > 10 UNION ALL SELECT c1, c2 FROM t1 WHERE c1 > 20"
);
}
TEST_F
(
PlanSetOpTest
,
unionAllSubquery
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT * FROM (SELECT c1, c2 FROM t1 UNION ALL SELECT c1, c2 FROM t1)"
);
}
TEST_F
(
PlanSetOpTest
,
union
)
{
useDb
(
"root"
,
"test"
);
run
(
"select c1, c2 from t1 where c1 > 10 union select c1, c2 from t1 where c1 > 20"
);
run
(
"SELECT c1, c2 FROM t1 WHERE c1 > 10 UNION SELECT c1, c2 FROM t1 WHERE c1 > 20"
);
}
TEST_F
(
PlanSetOpTest
,
unionContainJoin
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT t1.c1 FROM st1s1 t1 join st1s2 t2 on t1.ts = t2.ts "
"WHERE t1.c1 IS NOT NULL GROUP BY t1.c1 HAVING t1.c1 IS NOT NULL "
"UNION "
"SELECT t1.c1 FROM st1s1 t1 join st1s2 t2 on t1.ts = t2.ts "
"WHERE t1.c1 IS NOT NULL GROUP BY t1.c1 HAVING t1.c1 IS NOT NULL"
);
}
TEST_F
(
PlanSetOpTest
,
unionSubquery
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT * FROM (SELECT c1, c2 FROM t1 UNION SELECT c1, c2 FROM t1)"
);
}
source/libs/qworker/src/qworker.c
浏览文件 @
aa2faab1
...
...
@@ -110,9 +110,9 @@ void qwDbgDumpMgmtInfo(SQWorker *mgmt) {
QW_LOCK
(
QW_READ
,
&
mgmt
->
schLock
);
QW_DUMP
(
"total remain schduler num:%d"
,
taosHashGetSize
(
mgmt
->
schHash
));
/*QW_DUMP("total remain schduler num:%d", taosHashGetSize(mgmt->schHash));*/
void
*
key
=
NULL
;
void
*
key
=
NULL
;
size_t
keyLen
=
0
;
int32_t
i
=
0
;
SQWSchStatus
*
sch
=
NULL
;
...
...
@@ -127,7 +127,7 @@ void qwDbgDumpMgmtInfo(SQWorker *mgmt) {
QW_UNLOCK
(
QW_READ
,
&
mgmt
->
schLock
);
QW_DUMP
(
"total remain ctx num:%d"
,
taosHashGetSize
(
mgmt
->
ctxHash
));
/*QW_DUMP("total remain ctx num:%d", taosHashGetSize(mgmt->ctxHash));*/
}
char
*
qwPhaseStr
(
int32_t
phase
)
{
...
...
@@ -462,7 +462,7 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) {
}
int32_t
qwDropTaskStatus
(
QW_FPARAMS_DEF
)
{
SQWSchStatus
*
sch
=
NULL
;
SQWSchStatus
*
sch
=
NULL
;
SQWTaskStatus
*
task
=
NULL
;
int32_t
code
=
0
;
...
...
@@ -499,7 +499,7 @@ _return:
}
int32_t
qwUpdateTaskStatus
(
QW_FPARAMS_DEF
,
int8_t
status
)
{
SQWSchStatus
*
sch
=
NULL
;
SQWSchStatus
*
sch
=
NULL
;
SQWTaskStatus
*
task
=
NULL
;
int32_t
code
=
0
;
...
...
@@ -550,11 +550,11 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
int32_t
qwExecTask
(
QW_FPARAMS_DEF
,
SQWTaskCtx
*
ctx
,
bool
*
queryEnd
)
{
int32_t
code
=
0
;
bool
qcontinue
=
true
;
SSDataBlock
*
pRes
=
NULL
;
SSDataBlock
*
pRes
=
NULL
;
uint64_t
useconds
=
0
;
int32_t
i
=
0
;
int32_t
execNum
=
0
;
qTaskInfo_t
*
taskHandle
=
&
ctx
->
taskHandle
;
qTaskInfo_t
*
taskHandle
=
&
ctx
->
taskHandle
;
DataSinkHandle
sinkHandle
=
ctx
->
sinkHandle
;
while
(
true
)
{
...
...
@@ -632,7 +632,7 @@ int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo)
return
TSDB_CODE_QRY_OUT_OF_MEMORY
;
}
void
*
key
=
NULL
;
void
*
key
=
NULL
;
size_t
keyLen
=
0
;
int32_t
i
=
0
;
STaskStatus
status
=
{
0
};
...
...
@@ -720,7 +720,7 @@ int32_t qwGetResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, void
int32_t
qwHandlePrePhaseEvents
(
QW_FPARAMS_DEF
,
int8_t
phase
,
SQWPhaseInput
*
input
,
SQWPhaseOutput
*
output
)
{
int32_t
code
=
0
;
SQWTaskCtx
*
ctx
=
NULL
;
SQWTaskCtx
*
ctx
=
NULL
;
SRpcHandleInfo
*
dropConnection
=
NULL
;
SRpcHandleInfo
*
cancelConnection
=
NULL
;
...
...
@@ -927,11 +927,11 @@ _return:
int32_t
qwProcessQuery
(
QW_FPARAMS_DEF
,
SQWMsg
*
qwMsg
,
int8_t
taskType
,
int8_t
explain
)
{
int32_t
code
=
0
;
bool
queryRsped
=
false
;
SSubplan
*
plan
=
NULL
;
SSubplan
*
plan
=
NULL
;
SQWPhaseInput
input
=
{
0
};
qTaskInfo_t
pTaskInfo
=
NULL
;
DataSinkHandle
sinkHandle
=
NULL
;
SQWTaskCtx
*
ctx
=
NULL
;
SQWTaskCtx
*
ctx
=
NULL
;
QW_ERR_JRET
(
qwRegisterQueryBrokenLinkArg
(
QW_FPARAMS
(),
&
qwMsg
->
connInfo
));
...
...
@@ -944,7 +944,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex
ctx
->
ctrlConnInfo
=
qwMsg
->
connInfo
;
QW_TASK_DLOGL
(
"subplan json string, len:%d, %s"
,
qwMsg
->
msgLen
,
qwMsg
->
msg
);
/*QW_TASK_DLOGL("subplan json string, len:%d, %s", qwMsg->msgLen, qwMsg->msg);*/
code
=
qStringToSubplan
(
qwMsg
->
msg
,
&
plan
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
...
...
@@ -1055,10 +1055,10 @@ _return:
}
int32_t
qwProcessCQuery
(
QW_FPARAMS_DEF
,
SQWMsg
*
qwMsg
)
{
SQWTaskCtx
*
ctx
=
NULL
;
SQWTaskCtx
*
ctx
=
NULL
;
int32_t
code
=
0
;
SQWPhaseInput
input
=
{
0
};
void
*
rsp
=
NULL
;
void
*
rsp
=
NULL
;
int32_t
dataLen
=
0
;
bool
queryEnd
=
false
;
...
...
@@ -1138,8 +1138,8 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
int32_t
code
=
0
;
int32_t
dataLen
=
0
;
bool
locked
=
false
;
SQWTaskCtx
*
ctx
=
NULL
;
void
*
rsp
=
NULL
;
SQWTaskCtx
*
ctx
=
NULL
;
void
*
rsp
=
NULL
;
SQWPhaseInput
input
=
{
0
};
QW_ERR_JRET
(
qwHandlePrePhaseEvents
(
QW_FPARAMS
(),
QW_PHASE_PRE_FETCH
,
&
input
,
NULL
));
...
...
@@ -1274,7 +1274,7 @@ _return:
int32_t
qwProcessHbLinkBroken
(
SQWorker
*
mgmt
,
SQWMsg
*
qwMsg
,
SSchedulerHbReq
*
req
)
{
int32_t
code
=
0
;
SSchedulerHbRsp
rsp
=
{
0
};
SQWSchStatus
*
sch
=
NULL
;
SQWSchStatus
*
sch
=
NULL
;
QW_ERR_RET
(
qwAcquireAddScheduler
(
mgmt
,
req
->
sId
,
QW_READ
,
&
sch
));
...
...
@@ -1300,7 +1300,7 @@ int32_t qwProcessHbLinkBroken(SQWorker *mgmt, SQWMsg *qwMsg, SSchedulerHbReq *re
int32_t
qwProcessHb
(
SQWorker
*
mgmt
,
SQWMsg
*
qwMsg
,
SSchedulerHbReq
*
req
)
{
int32_t
code
=
0
;
SSchedulerHbRsp
rsp
=
{
0
};
SQWSchStatus
*
sch
=
NULL
;
SQWSchStatus
*
sch
=
NULL
;
if
(
qwMsg
->
code
)
{
QW_RET
(
qwProcessHbLinkBroken
(
mgmt
,
qwMsg
,
req
));
...
...
@@ -1338,13 +1338,13 @@ _return:
qwMsg
->
connInfo
.
handle
=
NULL
;
}
QW_DLOG
(
"hb rsp send, handle:%p, code:%x - %s"
,
qwMsg
->
connInfo
.
handle
,
code
,
tstrerror
(
code
));
/*QW_DLOG("hb rsp send, handle:%p, code:%x - %s", qwMsg->connInfo.handle, code, tstrerror(code));*/
QW_RET
(
TSDB_CODE_SUCCESS
);
}
void
qwProcessHbTimerEvent
(
void
*
param
,
void
*
tmrId
)
{
SQWHbParam
*
hbParam
=
(
SQWHbParam
*
)
param
;
SQWHbParam
*
hbParam
=
(
SQWHbParam
*
)
param
;
if
(
hbParam
->
qwrId
!=
atomic_load_32
(
&
gQwMgmt
.
qwRef
))
{
return
;
}
...
...
@@ -1359,7 +1359,7 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
SQWSchStatus
*
sch
=
NULL
;
int32_t
taskNum
=
0
;
SQWHbInfo
*
rspList
=
NULL
;
SQWHbInfo
*
rspList
=
NULL
;
int32_t
code
=
0
;
qwDbgDumpMgmtInfo
(
mgmt
);
...
...
@@ -1383,7 +1383,7 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
return
;
}
void
*
key
=
NULL
;
void
*
key
=
NULL
;
size_t
keyLen
=
0
;
int32_t
i
=
0
;
...
...
@@ -1413,8 +1413,8 @@ _return:
for
(
int32_t
j
=
0
;
j
<
i
;
++
j
)
{
qwBuildAndSendHbRsp
(
&
rspList
[
j
].
connInfo
,
&
rspList
[
j
].
rsp
,
code
);
QW_DLOG
(
"hb rsp send, handle:%p, code:%x - %s, taskNum:%d"
,
rspList
[
j
].
connInfo
.
handle
,
code
,
tstrerror
(
code
),
(
rspList
[
j
].
rsp
.
taskStatus
?
(
int32_t
)
taosArrayGetSize
(
rspList
[
j
].
rsp
.
taskStatus
)
:
0
));
/*QW_DLOG("hb rsp send, handle:%p, code:%x - %s, taskNum:%d", rspList[j].connInfo.handle, code, tstrerror(code),*/
/*(rspList[j].rsp.taskStatus ? (int32_t)taosArrayGetSize(rspList[j].rsp.taskStatus) : 0));*/
tFreeSSchedulerHbRsp
(
&
rspList
[
j
].
rsp
);
}
...
...
@@ -1428,14 +1428,12 @@ void qwCloseRef(void) {
taosWLockLatch
(
&
gQwMgmt
.
lock
);
if
(
atomic_load_32
(
&
gQwMgmt
.
qwNum
)
<=
0
&&
gQwMgmt
.
qwRef
>=
0
)
{
taosCloseRef
(
gQwMgmt
.
qwRef
);
gQwMgmt
.
qwRef
=
-
1
;
gQwMgmt
.
qwRef
=
-
1
;
}
taosWUnLockLatch
(
&
gQwMgmt
.
lock
);
}
void
qwDestroySchStatus
(
SQWSchStatus
*
pStatus
)
{
taosHashCleanup
(
pStatus
->
tasksHash
);
}
void
qwDestroySchStatus
(
SQWSchStatus
*
pStatus
)
{
taosHashCleanup
(
pStatus
->
tasksHash
);
}
void
qwDestroyImpl
(
void
*
pMgmt
)
{
SQWorker
*
mgmt
=
(
SQWorker
*
)
pMgmt
;
...
...
@@ -1467,7 +1465,7 @@ void qwDestroyImpl(void *pMgmt) {
int32_t
qwOpenRef
(
void
)
{
taosWLockLatch
(
&
gQwMgmt
.
lock
);
if
(
gQwMgmt
.
qwRef
<
0
)
{
gQwMgmt
.
qwRef
=
taosOpenRef
(
100
,
qwDestroyImpl
);
gQwMgmt
.
qwRef
=
taosOpenRef
(
100
,
qwDestroyImpl
);
if
(
gQwMgmt
.
qwRef
<
0
)
{
taosWUnLockLatch
(
&
gQwMgmt
.
lock
);
qError
(
"init qworker ref failed"
);
...
...
@@ -1577,7 +1575,7 @@ int32_t qWorkerInit(int8_t nodeType, int32_t nodeId, SQWorkerCfg *cfg, void **qW
SQWHbParam
*
param
=
NULL
;
qwSetHbParam
(
mgmt
->
refId
,
&
param
);
mgmt
->
hbTimer
=
taosTmrStart
(
qwProcessHbTimerEvent
,
QW_DEFAULT_HEARTBEAT_MSEC
,
(
void
*
)
param
,
mgmt
->
timer
);
mgmt
->
hbTimer
=
taosTmrStart
(
qwProcessHbTimerEvent
,
QW_DEFAULT_HEARTBEAT_MSEC
,
(
void
*
)
param
,
mgmt
->
timer
);
if
(
NULL
==
mgmt
->
hbTimer
)
{
qError
(
"start hb timer failed"
);
QW_ERR_JRET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
...
...
@@ -1678,7 +1676,7 @@ int32_t qwUpdateSchLastAccess(SQWorker *mgmt, uint64_t sId, uint64_t qId, uint64
}
int32_t
qwGetTaskStatus
(
SQWorker
*
mgmt
,
uint64_t
sId
,
uint64_t
qId
,
uint64_t
tId
,
int8_t
*
taskStatus
)
{
SQWSchStatus
*
sch
=
NULL
;
SQWSchStatus
*
sch
=
NULL
;
SQWTaskStatus
*
task
=
NULL
;
int32_t
code
=
0
;
...
...
@@ -1705,7 +1703,7 @@ int32_t qwGetTaskStatus(SQWorker *mgmt, uint64_t sId, uint64_t qId, uint64_t tId
}
int32_t
qwCancelTask
(
SQWorker
*
mgmt
,
uint64_t
sId
,
uint64_t
qId
,
uint64_t
tId
)
{
SQWSchStatus
*
sch
=
NULL
;
SQWSchStatus
*
sch
=
NULL
;
SQWTaskStatus
*
task
=
NULL
;
int32_t
code
=
0
;
...
...
source/libs/tdb/inc/tdb.h
浏览文件 @
aa2faab1
...
...
@@ -22,7 +22,7 @@
extern
"C"
{
#endif
typedef
int
(
*
tdb_cmpr_fn_t
)(
const
void
*
pKey1
,
int
kLen1
,
const
void
*
pKey2
,
in
t
kLen2
);
typedef
int
(
*
tdb_cmpr_fn_t
)(
const
void
*
pKey1
,
int
32_t
kLen1
,
const
void
*
pKey2
,
int32_
t
kLen2
);
// exposed types
typedef
struct
STDB
TDB
;
...
...
@@ -31,42 +31,42 @@ typedef struct STBC TBC;
typedef
struct
STxn
TXN
;
// TDB
int
tdbOpen
(
const
char
*
rootDir
,
int
szPage
,
int
pages
,
TDB
**
ppDb
);
int
tdbClose
(
TDB
*
pDb
);
int
tdbBegin
(
TDB
*
pDb
,
TXN
*
pTxn
);
int
tdbCommit
(
TDB
*
pDb
,
TXN
*
pTxn
);
int
32_t
tdbOpen
(
const
char
*
dbname
,
int
szPage
,
int
pages
,
TDB
**
ppDb
);
int
32_t
tdbClose
(
TDB
*
pDb
);
int
32_t
tdbBegin
(
TDB
*
pDb
,
TXN
*
pTxn
);
int
32_t
tdbCommit
(
TDB
*
pDb
,
TXN
*
pTxn
);
// TTB
int
tdbTbOpen
(
const
char
*
f
name
,
int
keyLen
,
int
valLen
,
tdb_cmpr_fn_t
keyCmprFn
,
TDB
*
pEnv
,
TTB
**
ppTb
);
int
tdbTbClose
(
TTB
*
pTb
);
int
tdbTbDrop
(
TTB
*
pTb
);
int
tdbTbInsert
(
TTB
*
pTb
,
const
void
*
pKey
,
int
keyLen
,
const
void
*
pVal
,
int
valLen
,
TXN
*
pTxn
);
int
tdbTbDelete
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
TXN
*
pTxn
);
int
tdbTbUpsert
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
const
void
*
pVal
,
int
vLen
,
TXN
*
pTxn
);
int
tdbTbGet
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
void
**
ppVal
,
int
*
vLen
);
int
tdbTbPGet
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
void
**
ppKey
,
int
*
pkLen
,
void
**
ppVal
,
int
*
vLen
);
int
32_t
tdbTbOpen
(
const
char
*
tb
name
,
int
keyLen
,
int
valLen
,
tdb_cmpr_fn_t
keyCmprFn
,
TDB
*
pEnv
,
TTB
**
ppTb
);
int
32_t
tdbTbClose
(
TTB
*
pTb
);
int
32_t
tdbTbDrop
(
TTB
*
pTb
);
int
32_t
tdbTbInsert
(
TTB
*
pTb
,
const
void
*
pKey
,
int
keyLen
,
const
void
*
pVal
,
int
valLen
,
TXN
*
pTxn
);
int
32_t
tdbTbDelete
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
TXN
*
pTxn
);
int
32_t
tdbTbUpsert
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
const
void
*
pVal
,
int
vLen
,
TXN
*
pTxn
);
int
32_t
tdbTbGet
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
void
**
ppVal
,
int
*
vLen
);
int
32_t
tdbTbPGet
(
TTB
*
pTb
,
const
void
*
pKey
,
int
kLen
,
void
**
ppKey
,
int
*
pkLen
,
void
**
ppVal
,
int
*
vLen
);
// TBC
int
tdbTbcOpen
(
TTB
*
pTb
,
TBC
**
ppTbc
,
TXN
*
pTxn
);
int
tdbTbcClose
(
TBC
*
pTbc
);
int
tdbTbcIsValid
(
TBC
*
pTbc
);
int
tdbTbcMoveTo
(
TBC
*
pTbc
,
const
void
*
pKey
,
int
kLen
,
int
*
c
);
int
tdbTbcMoveToFirst
(
TBC
*
pTbc
);
int
tdbTbcMoveToLast
(
TBC
*
pTbc
);
int
tdbTbcMoveToNext
(
TBC
*
pTbc
);
int
tdbTbcMoveToPrev
(
TBC
*
pTbc
);
int
tdbTbcGet
(
TBC
*
pTbc
,
const
void
**
ppKey
,
int
*
pkLen
,
const
void
**
ppVal
,
int
*
pvLen
);
int
tdbTbcDelete
(
TBC
*
pTbc
);
int
tdbTbcNext
(
TBC
*
pTbc
,
void
**
ppKey
,
int
*
kLen
,
void
**
ppVal
,
int
*
vLen
);
int
tdbTbcUpsert
(
TBC
*
pTbc
,
const
void
*
pKey
,
int
nKey
,
const
void
*
pData
,
int
nData
,
int
insert
);
int
32_t
tdbTbcOpen
(
TTB
*
pTb
,
TBC
**
ppTbc
,
TXN
*
pTxn
);
int
32_t
tdbTbcClose
(
TBC
*
pTbc
);
int
32_t
tdbTbcIsValid
(
TBC
*
pTbc
);
int
32_t
tdbTbcMoveTo
(
TBC
*
pTbc
,
const
void
*
pKey
,
int
kLen
,
int
*
c
);
int
32_t
tdbTbcMoveToFirst
(
TBC
*
pTbc
);
int
32_t
tdbTbcMoveToLast
(
TBC
*
pTbc
);
int
32_t
tdbTbcMoveToNext
(
TBC
*
pTbc
);
int
32_t
tdbTbcMoveToPrev
(
TBC
*
pTbc
);
int
32_t
tdbTbcGet
(
TBC
*
pTbc
,
const
void
**
ppKey
,
int
*
pkLen
,
const
void
**
ppVal
,
int
*
pvLen
);
int
32_t
tdbTbcDelete
(
TBC
*
pTbc
);
int
32_t
tdbTbcNext
(
TBC
*
pTbc
,
void
**
ppKey
,
int
*
kLen
,
void
**
ppVal
,
int
*
vLen
);
int
32_t
tdbTbcUpsert
(
TBC
*
pTbc
,
const
void
*
pKey
,
int
nKey
,
const
void
*
pData
,
int
nData
,
int
insert
);
// TXN
#define TDB_TXN_WRITE 0x1
#define TDB_TXN_READ_UNCOMMITTED 0x2
int
tdbTxnOpen
(
TXN
*
pTxn
,
int64_t
txnid
,
void
*
(
*
xMalloc
)(
void
*
,
size_t
),
void
(
*
xFree
)(
void
*
,
void
*
),
void
*
xArg
,
int
flags
);
int
tdbTxnClose
(
TXN
*
pTxn
);
int
32_t
tdbTxnOpen
(
TXN
*
pTxn
,
int64_t
txnid
,
void
*
(
*
xMalloc
)(
void
*
,
size_t
),
void
(
*
xFree
)(
void
*
,
void
*
)
,
void
*
xArg
,
int
flags
);
int
32_t
tdbTxnClose
(
TXN
*
pTxn
);
// other
void
tdbFree
(
void
*
);
...
...
source/libs/tdb/src/db/tdbDb.c
浏览文件 @
aa2faab1
...
...
@@ -15,7 +15,7 @@
#include "tdbInt.h"
int
tdbOpen
(
const
char
*
rootDir
,
int
szPage
,
in
t
pages
,
TDB
**
ppDb
)
{
int
32_t
tdbOpen
(
const
char
*
dbname
,
int32_t
szPage
,
int32_
t
pages
,
TDB
**
ppDb
)
{
TDB
*
pDb
;
int
dsize
;
int
zsize
;
...
...
@@ -25,7 +25,7 @@ int tdbOpen(const char *rootDir, int szPage, int pages, TDB **ppDb) {
*
ppDb
=
NULL
;
dsize
=
strlen
(
rootDir
);
dsize
=
strlen
(
dbname
);
zsize
=
sizeof
(
*
pDb
)
+
dsize
*
2
+
strlen
(
TDB_JOURNAL_NAME
)
+
3
;
pPtr
=
(
uint8_t
*
)
tdbOsCalloc
(
1
,
zsize
);
...
...
@@ -36,16 +36,16 @@ int tdbOpen(const char *rootDir, int szPage, int pages, TDB **ppDb) {
pDb
=
(
TDB
*
)
pPtr
;
pPtr
+=
sizeof
(
*
pDb
);
// pDb->rootDir
pDb
->
rootDir
=
pPtr
;
memcpy
(
pDb
->
rootDir
,
rootDir
,
dsize
);
pDb
->
rootDir
[
dsize
]
=
'\0'
;
pDb
->
dbName
=
pPtr
;
memcpy
(
pDb
->
dbName
,
dbname
,
dsize
);
pDb
->
dbName
[
dsize
]
=
'\0'
;
pPtr
=
pPtr
+
dsize
+
1
;
// pDb->jfname
pDb
->
j
fn
ame
=
pPtr
;
memcpy
(
pDb
->
j
fname
,
rootDir
,
dsize
);
pDb
->
j
fn
ame
[
dsize
]
=
'/'
;
memcpy
(
pDb
->
j
fn
ame
+
dsize
+
1
,
TDB_JOURNAL_NAME
,
strlen
(
TDB_JOURNAL_NAME
));
pDb
->
j
fn
ame
[
dsize
+
1
+
strlen
(
TDB_JOURNAL_NAME
)]
=
'\0'
;
pDb
->
j
nN
ame
=
pPtr
;
memcpy
(
pDb
->
j
nName
,
dbname
,
dsize
);
pDb
->
j
nN
ame
[
dsize
]
=
'/'
;
memcpy
(
pDb
->
j
nN
ame
+
dsize
+
1
,
TDB_JOURNAL_NAME
,
strlen
(
TDB_JOURNAL_NAME
));
pDb
->
j
nN
ame
[
dsize
+
1
+
strlen
(
TDB_JOURNAL_NAME
)]
=
'\0'
;
pDb
->
jfd
=
-
1
;
...
...
@@ -62,7 +62,7 @@ int tdbOpen(const char *rootDir, int szPage, int pages, TDB **ppDb) {
}
memset
(
pDb
->
pgrHash
,
0
,
tsize
);
mkdir
(
rootDir
,
0755
);
mkdir
(
dbname
,
0755
);
*
ppDb
=
pDb
;
return
0
;
...
...
source/libs/tdb/src/db/tdbTable.c
浏览文件 @
aa2faab1
...
...
@@ -24,7 +24,7 @@ struct STBC {
SBTC
btc
;
};
int
tdbTbOpen
(
const
char
*
f
name
,
int
keyLen
,
int
valLen
,
tdb_cmpr_fn_t
keyCmprFn
,
TDB
*
pEnv
,
TTB
**
ppTb
)
{
int
tdbTbOpen
(
const
char
*
tb
name
,
int
keyLen
,
int
valLen
,
tdb_cmpr_fn_t
keyCmprFn
,
TDB
*
pEnv
,
TTB
**
ppTb
)
{
TTB
*
pTb
;
SPager
*
pPager
;
int
ret
;
...
...
@@ -42,9 +42,9 @@ int tdbTbOpen(const char *fname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprFn
// pTb->pEnv
pTb
->
pEnv
=
pEnv
;
pPager
=
tdbEnvGetPager
(
pEnv
,
f
name
);
pPager
=
tdbEnvGetPager
(
pEnv
,
tb
name
);
if
(
pPager
==
NULL
)
{
snprintf
(
fFullName
,
TDB_FILENAME_LEN
,
"%s/%s"
,
pEnv
->
rootDir
,
f
name
);
snprintf
(
fFullName
,
TDB_FILENAME_LEN
,
"%s/%s"
,
pEnv
->
dbName
,
tb
name
);
ret
=
tdbPagerOpen
(
pEnv
->
pCache
,
fFullName
,
&
pPager
);
if
(
ret
<
0
)
{
return
-
1
;
...
...
source/libs/tdb/src/inc/tdbInt.h
浏览文件 @
aa2faab1
...
...
@@ -335,8 +335,8 @@ static inline SCell *tdbPageGetCell(SPage *pPage, int idx) {
}
struct
STDB
{
char
*
rootDir
;
char
*
j
fn
ame
;
char
*
dbName
;
char
*
j
nN
ame
;
int
jfd
;
SPCache
*
pCache
;
SPager
*
pgrList
;
...
...
tests/script/tsim/tstream/basic1.sim
浏览文件 @
aa2faab1
...
...
@@ -24,7 +24,7 @@ sql insert into t1 values(1648791233002,3,2,3,2.1);
sql insert into t1 values(1648791243003,4,2,3,3.1);
sql insert into t1 values(1648791213004,4,2,3,4.1);
sleep 1000
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
if $rows != 4 then
print ======$rows
...
...
@@ -137,7 +137,7 @@ endi
sql insert into t1 values(1648791223001,12,14,13,11.1);
sleep 500
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
if $rows != 4 then
print ======$rows
...
...
@@ -250,7 +250,7 @@ endi
sql insert into t1 values(1648791223002,12,14,13,11.1);
sleep 100
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 2 then
...
...
@@ -280,7 +280,7 @@ endi
sql insert into t1 values(1648791223003,12,14,13,11.1);
sleep 100
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 3 then
...
...
@@ -312,7 +312,7 @@ sql insert into t1 values(1648791223001,1,1,1,1.1);
sql insert into t1 values(1648791223002,2,2,2,2.1);
sql insert into t1 values(1648791223003,3,3,3,3.1);
sleep 100
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 3 then
...
...
@@ -344,7 +344,7 @@ sql insert into t1 values(1648791233003,3,2,3,2.1);
sql insert into t1 values(1648791233002,5,6,7,8.1);
sql insert into t1 values(1648791233002,3,2,3,2.1);
sleep 100
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
# row 2
if $data21 != 2 then
...
...
@@ -374,7 +374,7 @@ endi
sql insert into t1 values(1648791213004,4,2,3,4.1) (1648791213006,5,4,7,9.1) (1648791213004,40,20,30,40.1) (1648791213005,4,2,3,4.1);
sleep 100
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
# row 0
if $data01 != 4 then
...
...
@@ -404,7 +404,7 @@ endi
sql insert into t1 values(1648791223004,4,2,3,4.1) (1648791233006,5,4,7,9.1) (1648791223004,40,20,30,40.1) (1648791233005,4,2,3,4.1);
sleep 100
sql select
_wstartts
, c1, c2 ,c3 ,c4, c5 from streamt;
sql select
`_wstartts`
, c1, c2 ,c3 ,c4, c5 from streamt;
# row 1
if $data11 != 4 then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录