Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ba72ce2b
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ba72ce2b
编写于
7月 04, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into idx
上级
bd77e5b1
2450d598
变更
46
隐藏空白更改
内联
并排
Showing
46 changed file
with
2081 addition
and
1131 deletion
+2081
-1131
Jenkinsfile2
Jenkinsfile2
+30
-0
include/libs/nodes/nodes.h
include/libs/nodes/nodes.h
+3
-2
include/libs/scalar/scalar.h
include/libs/scalar/scalar.h
+2
-0
include/util/taoserror.h
include/util/taoserror.h
+3
-0
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+2
-3
source/libs/index/inc/indexFst.h
source/libs/index/inc/indexFst.h
+7
-7
source/libs/index/inc/indexFstFile.h
source/libs/index/inc/indexFstFile.h
+96
-0
source/libs/index/inc/indexFstNode.h
source/libs/index/inc/indexFstNode.h
+4
-4
source/libs/index/inc/indexTfile.h
source/libs/index/inc/indexTfile.h
+5
-5
source/libs/index/src/index.c
source/libs/index/src/index.c
+1
-1
source/libs/index/src/indexFst.c
source/libs/index/src/indexFst.c
+30
-32
source/libs/index/src/indexFstDfa.c
source/libs/index/src/indexFstDfa.c
+2
-1
source/libs/index/src/indexFstFile.c
source/libs/index/src/indexFstFile.c
+38
-46
source/libs/index/src/indexFstNode.c
source/libs/index/src/indexFstNode.c
+1
-1
source/libs/index/src/indexFstUtil.c
source/libs/index/src/indexFstUtil.c
+0
-14
source/libs/index/src/indexTfile.c
source/libs/index/src/indexTfile.c
+17
-16
source/libs/index/test/fstTest.cc
source/libs/index/test/fstTest.cc
+13
-14
source/libs/index/test/fstUT.cc
source/libs/index/test/fstUT.cc
+13
-14
source/libs/index/test/indexTests.cc
source/libs/index/test/indexTests.cc
+15
-16
source/libs/index/test/jsonUT.cc
source/libs/index/test/jsonUT.cc
+0
-1
source/libs/index/test/utilUT.cc
source/libs/index/test/utilUT.cc
+0
-1
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+19
-10
source/libs/parser/inc/parAst.h
source/libs/parser/inc/parAst.h
+1
-0
source/libs/parser/inc/parUtil.h
source/libs/parser/inc/parUtil.h
+1
-0
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+2
-2
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+5
-0
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+6
-0
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+67
-25
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+203
-140
source/libs/parser/src/parUtil.c
source/libs/parser/src/parUtil.c
+9
-1
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+695
-667
source/libs/parser/test/parInitialATest.cpp
source/libs/parser/test/parInitialATest.cpp
+14
-16
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+4
-2
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+4
-0
source/libs/planner/test/planOptimizeTest.cpp
source/libs/planner/test/planOptimizeTest.cpp
+2
-0
source/libs/planner/test/planSetOpTest.cpp
source/libs/planner/test/planSetOpTest.cpp
+9
-1
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+11
-6
source/util/src/terror.c
source/util/src/terror.c
+1
-0
tests/script/tsim/insert/update0.sim
tests/script/tsim/insert/update0.sim
+2
-2
tests/system-test/1-insert/block_wise.py
tests/system-test/1-insert/block_wise.py
+442
-0
tests/system-test/1-insert/create_retentions.py
tests/system-test/1-insert/create_retentions.py
+34
-58
tests/system-test/1-insert/time_range_wise.py
tests/system-test/1-insert/time_range_wise.py
+13
-14
tests/system-test/2-query/json_tag.py
tests/system-test/2-query/json_tag.py
+1
-1
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
+241
-0
tests/system-test/7-tmq/tmqConsFromTsdb1.py
tests/system-test/7-tmq/tmqConsFromTsdb1.py
+1
-1
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+12
-7
未找到文件。
Jenkinsfile2
浏览文件 @
ba72ce2b
...
...
@@ -127,6 +127,25 @@ def pre_test(){
'''
return 1
}
def pre_test_build_mac() {
sh '''
hostname
date
'''
sh '''
cd ${WK}
rm -rf debug
mkdir debug
'''
sh '''
cd ${WK}/debug
cmake ..
make -j8
'''
sh '''
date
'''
}
def pre_test_win(){
bat '''
hostname
...
...
@@ -334,6 +353,17 @@ pipeline {
}
}
}
stage('mac test') {
agent{label " Mac_catalina "}
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
timeout(time: 20, unit: 'MINUTES'){
pre_test()
pre_test_build_mac()
}
}
}
}
stage('linux test') {
agent{label " worker03 || slave215 || slave217 || slave219 "}
options { skipDefaultCheckout() }
...
...
include/libs/nodes/nodes.h
浏览文件 @
ba72ce2b
...
...
@@ -22,8 +22,8 @@ extern "C" {
#include "tdef.h"
#define nodeType(nodeptr) (((const SNode*)(nodeptr))->type)
#define setNodeType(nodeptr,
type) (((SNode*)(nodeptr))->type = (
type))
#define nodeType(nodeptr)
(((const SNode*)(nodeptr))->type)
#define setNodeType(nodeptr,
nodetype) (((SNode*)(nodeptr))->type = (node
type))
#define LIST_LENGTH(l) (NULL != (l) ? (l)->length : 0)
...
...
@@ -118,6 +118,7 @@ typedef enum ENodeType {
QUERY_NODE_DROP_TABLE_STMT
,
QUERY_NODE_DROP_SUPER_TABLE_STMT
,
QUERY_NODE_ALTER_TABLE_STMT
,
QUERY_NODE_ALTER_SUPER_TABLE_STMT
,
QUERY_NODE_CREATE_USER_STMT
,
QUERY_NODE_ALTER_USER_STMT
,
QUERY_NODE_DROP_USER_STMT
,
...
...
include/libs/scalar/scalar.h
浏览文件 @
ba72ce2b
...
...
@@ -25,6 +25,8 @@ extern "C" {
typedef
struct
SFilterInfo
SFilterInfo
;
int32_t
scalarGetOperatorResultType
(
SDataType
left
,
SDataType
right
,
EOperatorType
op
,
SDataType
*
pRes
);
/*
pNode will be freed in API;
*pRes need to freed in caller
...
...
include/util/taoserror.h
浏览文件 @
ba72ce2b
...
...
@@ -578,6 +578,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_PAR_INVALID_TABLE_OPTION TAOS_DEF_ERROR_CODE(0, 0x265C)
#define TSDB_CODE_PAR_INVALID_INTERP_CLAUSE TAOS_DEF_ERROR_CODE(0, 0x265D)
#define TSDB_CODE_PAR_NO_VALID_FUNC_IN_WIN TAOS_DEF_ERROR_CODE(0, 0x265E)
#define TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE TAOS_DEF_ERROR_CODE(0, 0x265F)
//planner
#define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700)
...
...
@@ -627,6 +628,8 @@ int32_t* taosGetErrno();
//index
#define TSDB_CODE_INDEX_REBUILDING TAOS_DEF_ERROR_CODE(0, 0x3200)
#define TSDB_CODE_INDEX_INVALID_FILE TAOS_DEF_ERROR_CODE(0, 0x3201)
//tmq
#define TSDB_CODE_TMQ_INVALID_MSG TAOS_DEF_ERROR_CODE(0, 0x4000)
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
ba72ce2b
...
...
@@ -915,9 +915,9 @@ static int32_t tdRSmaQTaskInfoItemRestore(SSma *pSma, const SRSmaQTaskInfoItem *
return
TSDB_CODE_SUCCESS
;
}
if
(
pItem
->
type
==
1
)
{
if
(
pItem
->
type
==
TSDB_RETENTION_L
1
)
{
qTaskInfo
=
pRSmaInfo
->
items
[
0
].
taskInfo
;
}
else
if
(
pItem
->
type
==
2
)
{
}
else
if
(
pItem
->
type
==
TSDB_RETENTION_L
2
)
{
qTaskInfo
=
pRSmaInfo
->
items
[
1
].
taskInfo
;
}
else
{
ASSERT
(
0
);
...
...
@@ -1233,7 +1233,6 @@ static void tdRSmaPersistTask(SRSmaStat *pRSmaStat) {
}
else
{
smaWarn
(
"vgId:%d, persist task in abnormal stat %"
PRIi8
,
SMA_VID
(
pRSmaStat
->
pSma
),
atomic_load_8
(
RSMA_TRIGGER_STAT
(
pRSmaStat
)));
ASSERT
(
0
);
}
atomic_store_8
(
RSMA_RUNNING_STAT
(
pRSmaStat
),
0
);
taosReleaseRef
(
smaMgmt
.
smaRef
,
pRSmaStat
->
refId
);
...
...
source/libs/index/inc/indexFst.h
浏览文件 @
ba72ce2b
...
...
@@ -21,7 +21,7 @@ extern "C" {
#endif
#include "indexFstAutomation.h"
#include "indexFst
CountingWriter
.h"
#include "indexFst
File
.h"
#include "indexFstNode.h"
#include "indexFstRegistry.h"
#include "indexFstUtil.h"
...
...
@@ -90,8 +90,8 @@ FstBuilderNode* fstUnFinishedNodesPopEmpty(FstUnFinishedNodes* nodes);
uint64_t
fstUnFinishedNodesFindCommPrefixAndSetOutput
(
FstUnFinishedNodes
*
node
,
FstSlice
bs
,
Output
in
,
Output
*
out
);
typedef
struct
FstBuilder
{
FstCountingWriter
*
wrt
;
// The FST raw data is written directly to `wtr`.
FstUnFinishedNodes
*
unfinished
;
// The stack of unfinished nodes
IdxFstFile
*
wrt
;
// The FST raw data is written directly to `wtr`.
FstUnFinishedNodes
*
unfinished
;
// The stack of unfinished
nodes
FstRegistry
*
registry
;
// A map of finished nodes.
FstSlice
last
;
// The last word added
CompiledAddr
lastAddr
;
// The address of the last compiled node
...
...
@@ -125,9 +125,9 @@ FstState fstStateCreateFrom(FstSlice* data, CompiledAddr addr);
FstState
fstStateCreate
(
State
state
);
// compile
void
fstStateCompileForOneTransNext
(
FstCountingWriter
*
w
,
CompiledAddr
addr
,
uint8_t
inp
);
void
fstStateCompileForOneTrans
(
FstCountingWriter
*
w
,
CompiledAddr
addr
,
FstTransition
*
trn
);
void
fstStateCompileForAnyTrans
(
FstCountingWriter
*
w
,
CompiledAddr
addr
,
FstBuilderNode
*
node
);
void
fstStateCompileForOneTransNext
(
IdxFstFile
*
w
,
CompiledAddr
addr
,
uint8_t
inp
);
void
fstStateCompileForOneTrans
(
IdxFstFile
*
w
,
CompiledAddr
addr
,
FstTransition
*
trn
);
void
fstStateCompileForAnyTrans
(
IdxFstFile
*
w
,
CompiledAddr
addr
,
FstBuilderNode
*
node
);
// set_comm_input
void
fstStateSetCommInput
(
FstState
*
state
,
uint8_t
inp
);
...
...
@@ -282,7 +282,7 @@ FStmSt* stmBuilderIntoStm(FStmBuilder* sb);
bool
fstVerify
(
Fst
*
fst
);
// refactor this function
bool
fstBuilderNodeCompileTo
(
FstBuilderNode
*
b
,
FstCountingWriter
*
wrt
,
CompiledAddr
lastAddr
,
CompiledAddr
startAddr
);
bool
fstBuilderNodeCompileTo
(
FstBuilderNode
*
b
,
IdxFstFile
*
wrt
,
CompiledAddr
lastAddr
,
CompiledAddr
startAddr
);
typedef
struct
StreamState
{
FstNode
*
node
;
...
...
source/libs/index/inc/indexFst
CountingWriter
.h
→
source/libs/index/inc/indexFst
File
.h
浏览文件 @
ba72ce2b
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INDEX_FST_
COUNTING_WRITER
_H__
#define __INDEX_FST_
COUNTING_WRITER
_H__
#ifndef __INDEX_FST_
FILE
_H__
#define __INDEX_FST_
FILE
_H__
#include "indexInt.h"
...
...
@@ -29,65 +29,65 @@ extern "C" {
static
char
tmpFile
[]
=
"./index"
;
typedef
enum
WriterType
{
TMemory
,
TFile
}
WriterType
;
typedef
struct
Writer
Ctx
{
int
(
*
write
)(
struct
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
int
(
*
read
)(
struct
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
int
(
*
flush
)(
struct
Writer
Ctx
*
ctx
);
int
(
*
readFrom
)(
struct
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
,
int32_t
offset
);
int
(
*
size
)(
struct
Writer
Ctx
*
ctx
);
typedef
struct
IFile
Ctx
{
int
(
*
write
)(
struct
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
int
(
*
read
)(
struct
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
int
(
*
flush
)(
struct
IFile
Ctx
*
ctx
);
int
(
*
readFrom
)(
struct
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
,
int32_t
offset
);
int
(
*
size
)(
struct
IFile
Ctx
*
ctx
);
WriterType
type
;
union
{
struct
{
TdFilePtr
pFile
;
bool
readOnly
;
char
buf
[
256
];
int
size
;
bool
readOnly
;
char
buf
[
256
];
int
64_t
size
;
#ifdef USE_MMAP
char
*
ptr
;
#endif
}
file
;
struct
{
int32_t
cap
a
;
int32_t
cap
;
char
*
buf
;
}
mem
;
};
int32_t
offset
;
int32_t
limit
;
}
Writer
Ctx
;
}
IFile
Ctx
;
static
int
writeCtxDoWrite
(
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
static
int
writeCtxDoRead
(
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
static
int
writeCtxDoReadFrom
(
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
,
int32_t
offset
);
static
int
writeCtxDoFlush
(
Writer
Ctx
*
ctx
);
static
int
idxFileCtxDoWrite
(
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
static
int
idxFileCtxDoRead
(
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
);
static
int
idxFileCtxDoReadFrom
(
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
,
int32_t
offset
);
static
int
idxFileCtxDoFlush
(
IFile
Ctx
*
ctx
);
WriterCtx
*
writer
CtxCreate
(
WriterType
type
,
const
char
*
path
,
bool
readOnly
,
int32_t
capacity
);
void
writerCtxDestroy
(
Writer
Ctx
*
w
,
bool
remove
);
IFileCtx
*
idxFile
CtxCreate
(
WriterType
type
,
const
char
*
path
,
bool
readOnly
,
int32_t
capacity
);
void
idxFileCtxDestroy
(
IFile
Ctx
*
w
,
bool
remove
);
typedef
uint32_t
CheckSummer
;
typedef
struct
FstCountingWriter
{
typedef
struct
IdxFstFile
{
void
*
wrt
;
// wrap any writer that counts and checksum bytes written
uint64_t
count
;
CheckSummer
summer
;
}
FstCountingWriter
;
}
IdxFstFile
;
int
fstCountingWriterWrite
(
FstCountingWriter
*
write
,
uint8_t
*
buf
,
uint32_t
len
);
int
idxFileWrite
(
IdxFstFile
*
write
,
uint8_t
*
buf
,
uint32_t
len
);
int
fstCountingWriterRead
(
FstCountingWriter
*
write
,
uint8_t
*
buf
,
uint32_t
len
);
int
idxFileRead
(
IdxFstFile
*
write
,
uint8_t
*
buf
,
uint32_t
len
);
int
fstCountingWriterFlush
(
FstCountingWriter
*
write
);
int
idxFileFlush
(
IdxFstFile
*
write
);
uint32_t
fstCountingWriterMaskedCheckSum
(
FstCountingWriter
*
write
);
uint32_t
idxFileMaskedCheckSum
(
IdxFstFile
*
write
);
FstCountingWriter
*
fstCountingWriter
Create
(
void
*
wtr
);
void
fstCountingWriterDestroy
(
FstCountingWriter
*
w
);
IdxFstFile
*
idxFile
Create
(
void
*
wtr
);
void
idxFileDestroy
(
IdxFstFile
*
w
);
void
fstCountingWriterPackUintIn
(
FstCountingWriter
*
writer
,
uint64_t
n
,
uint8_t
nBytes
);
uint8_t
fstCountingWriterPackUint
(
FstCountingWriter
*
writer
,
uint64_t
n
);
void
idxFilePackUintIn
(
IdxFstFile
*
writer
,
uint64_t
n
,
uint8_t
nBytes
);
uint8_t
idxFilePackUint
(
IdxFstFile
*
writer
,
uint64_t
n
);
#define FST_WRITER_COUNT(writer) (writer->count)
#define FST_WRITER_COUNT(writer)
(writer->count)
#define FST_WRITER_INTER_WRITER(writer) (writer->wtr)
#define FST_WRITE_CHECK_SUMMER(writer) (writer->summer)
#define FST_WRITE_CHECK_SUMMER(writer)
(writer->summer)
#ifdef __cplusplus
}
...
...
source/libs/index/inc/indexFstNode.h
浏览文件 @
ba72ce2b
...
...
@@ -20,12 +20,12 @@
extern
"C"
{
#endif
#include "indexFst
CountingWriter
.h"
#include "indexFst
File
.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#define FST_BUILDER_NODE_IS_FINAL(bn) (bn->isFinal)
#define FST_BUILDER_NODE_TRANS_ISEMPTY(bn) (taosArrayGetSize(bn->trans) == 0)
#define FST_BUILDER_NODE_IS_FINAL(bn)
(bn->isFinal)
#define FST_BUILDER_NODE_TRANS_ISEMPTY(bn)
(taosArrayGetSize(bn->trans) == 0)
#define FST_BUILDER_NODE_FINALOUTPUT_ISZERO(bn) (bn->finalOutput == 0)
typedef
struct
FstTransition
{
...
...
@@ -46,7 +46,7 @@ FstBuilderNode* fstBuilderNodeClone(FstBuilderNode* src);
void
fstBuilderNodeCloneFrom
(
FstBuilderNode
*
dst
,
FstBuilderNode
*
src
);
// bool fstBuilderNodeCompileTo(FstBuilderNode *b,
FstCountingWriter
*wrt,
// bool fstBuilderNodeCompileTo(FstBuilderNode *b,
IdxFile'
*wrt,
// CompiledAddr lastAddr, CompiledAddr startAddr);
bool
fstBuilderNodeEqual
(
FstBuilderNode
*
n1
,
FstBuilderNode
*
n2
);
...
...
source/libs/index/inc/indexTfile.h
浏览文件 @
ba72ce2b
...
...
@@ -16,7 +16,7 @@
#define __INDEX_TFILE_H__
#include "indexFst.h"
#include "indexFst
CountingWriter
.h"
#include "indexFst
File
.h"
#include "indexInt.h"
#include "indexTfile.h"
#include "indexUtil.h"
...
...
@@ -59,7 +59,7 @@ typedef struct TFileCache {
typedef
struct
TFileWriter
{
FstBuilder
*
fb
;
WriterCtx
*
ctx
;
IFileCtx
*
ctx
;
TFileHeader
header
;
uint32_t
offset
;
}
TFileWriter
;
...
...
@@ -68,7 +68,7 @@ typedef struct TFileWriter {
typedef
struct
TFileReader
{
T_REF_DECLARE
()
Fst
*
fst
;
WriterCtx
*
ctx
;
IFileCtx
*
ctx
;
TFileHeader
header
;
bool
remove
;
}
TFileReader
;
...
...
@@ -103,7 +103,7 @@ void tfileCachePut(TFileCache* tcache, ICacheKey* key, TFileReader* read
TFileReader
*
tfileGetReaderByCol
(
IndexTFile
*
tf
,
uint64_t
suid
,
char
*
colName
);
TFileReader
*
tfileReaderOpen
(
char
*
path
,
uint64_t
suid
,
int64_t
version
,
const
char
*
colName
);
TFileReader
*
tfileReaderCreate
(
Writer
Ctx
*
ctx
);
TFileReader
*
tfileReaderCreate
(
IFile
Ctx
*
ctx
);
void
tfileReaderDestroy
(
TFileReader
*
reader
);
int
tfileReaderSearch
(
TFileReader
*
reader
,
SIndexTermQuery
*
query
,
SIdxTRslt
*
tr
);
void
tfileReaderRef
(
TFileReader
*
reader
);
...
...
@@ -111,7 +111,7 @@ void tfileReaderUnRef(TFileReader* reader);
TFileWriter
*
tfileWriterOpen
(
char
*
path
,
uint64_t
suid
,
int64_t
version
,
const
char
*
colName
,
uint8_t
type
);
void
tfileWriterClose
(
TFileWriter
*
tw
);
TFileWriter
*
tfileWriterCreate
(
Writer
Ctx
*
ctx
,
TFileHeader
*
header
);
TFileWriter
*
tfileWriterCreate
(
IFile
Ctx
*
ctx
,
TFileHeader
*
header
);
void
tfileWriterDestroy
(
TFileWriter
*
tw
);
int
tfileWriterPut
(
TFileWriter
*
tw
,
void
*
data
,
bool
order
);
int
tfileWriterFinish
(
TFileWriter
*
tw
);
...
...
source/libs/index/src/index.c
浏览文件 @
ba72ce2b
...
...
@@ -663,7 +663,7 @@ static int idxGenTFile(SIndex* sIdx, IndexCache* cache, SArray* batch) {
return
ret
;
END:
if
(
tw
!=
NULL
)
{
writer
CtxDestroy
(
tw
->
ctx
,
true
);
idxFile
CtxDestroy
(
tw
->
ctx
,
true
);
taosMemoryFree
(
tw
);
}
return
-
1
;
...
...
source/libs/index/src/indexFst.c
浏览文件 @
ba72ce2b
...
...
@@ -19,11 +19,11 @@
#include "tchecksum.h"
#include "tcoding.h"
static
void
fstPackDeltaIn
(
FstCountingWriter
*
wrt
,
CompiledAddr
nodeAddr
,
CompiledAddr
transAddr
,
uint8_t
nBytes
)
{
static
void
fstPackDeltaIn
(
IdxFstFile
*
wrt
,
CompiledAddr
nodeAddr
,
CompiledAddr
transAddr
,
uint8_t
nBytes
)
{
CompiledAddr
deltaAddr
=
(
transAddr
==
EMPTY_ADDRESS
)
?
EMPTY_ADDRESS
:
nodeAddr
-
transAddr
;
fstCountingWriter
PackUintIn
(
wrt
,
deltaAddr
,
nBytes
);
idxFile
PackUintIn
(
wrt
,
deltaAddr
,
nBytes
);
}
static
uint8_t
fstPackDetla
(
FstCountingWriter
*
wrt
,
CompiledAddr
nodeAddr
,
CompiledAddr
transAddr
)
{
static
uint8_t
fstPackDetla
(
IdxFstFile
*
wrt
,
CompiledAddr
nodeAddr
,
CompiledAddr
transAddr
)
{
uint8_t
nBytes
=
packDeltaSize
(
nodeAddr
,
transAddr
);
fstPackDeltaIn
(
wrt
,
nodeAddr
,
transAddr
,
nBytes
);
return
nBytes
;
...
...
@@ -208,7 +208,7 @@ FstState fstStateCreate(State state) {
return
fstStateDict
[
idx
];
}
// compile
void
fstStateCompileForOneTransNext
(
FstCountingWriter
*
w
,
CompiledAddr
addr
,
uint8_t
inp
)
{
void
fstStateCompileForOneTransNext
(
IdxFstFile
*
w
,
CompiledAddr
addr
,
uint8_t
inp
)
{
FstState
s
=
fstStateCreate
(
OneTransNext
);
fstStateSetCommInput
(
&
s
,
inp
);
...
...
@@ -216,21 +216,21 @@ void fstStateCompileForOneTransNext(FstCountingWriter* w, CompiledAddr addr, uin
uint8_t
v
=
fstStateCommInput
(
&
s
,
&
null
);
if
(
null
)
{
// w->write_all(&[inp])
fstCountingWriter
Write
(
w
,
&
inp
,
1
);
idxFile
Write
(
w
,
&
inp
,
1
);
}
fstCountingWriter
Write
(
w
,
&
(
s
.
val
),
1
);
idxFile
Write
(
w
,
&
(
s
.
val
),
1
);
// w->write_all(&[s.val])
return
;
}
void
fstStateCompileForOneTrans
(
FstCountingWriter
*
w
,
CompiledAddr
addr
,
FstTransition
*
trn
)
{
void
fstStateCompileForOneTrans
(
IdxFstFile
*
w
,
CompiledAddr
addr
,
FstTransition
*
trn
)
{
Output
out
=
trn
->
out
;
uint8_t
outPackSize
=
(
out
==
0
?
0
:
fstCountingWriter
PackUint
(
w
,
out
));
uint8_t
outPackSize
=
(
out
==
0
?
0
:
idxFile
PackUint
(
w
,
out
));
uint8_t
transPackSize
=
fstPackDetla
(
w
,
addr
,
trn
->
addr
);
PackSizes
packSizes
=
0
;
FST_SET_OUTPUT_PACK_SIZE
(
packSizes
,
outPackSize
);
FST_SET_TRANSITION_PACK_SIZE
(
packSizes
,
transPackSize
);
fstCountingWriter
Write
(
w
,
(
char
*
)
&
packSizes
,
sizeof
(
packSizes
));
idxFile
Write
(
w
,
(
char
*
)
&
packSizes
,
sizeof
(
packSizes
));
FstState
st
=
fstStateCreate
(
OneTrans
);
...
...
@@ -239,12 +239,12 @@ void fstStateCompileForOneTrans(FstCountingWriter* w, CompiledAddr addr, FstTran
bool
null
=
false
;
uint8_t
inp
=
fstStateCommInput
(
&
st
,
&
null
);
if
(
null
==
true
)
{
fstCountingWriter
Write
(
w
,
(
char
*
)
&
trn
->
inp
,
sizeof
(
trn
->
inp
));
idxFile
Write
(
w
,
(
char
*
)
&
trn
->
inp
,
sizeof
(
trn
->
inp
));
}
fstCountingWriter
Write
(
w
,
(
char
*
)(
&
(
st
.
val
)),
sizeof
(
st
.
val
));
idxFile
Write
(
w
,
(
char
*
)(
&
(
st
.
val
)),
sizeof
(
st
.
val
));
return
;
}
void
fstStateCompileForAnyTrans
(
FstCountingWriter
*
w
,
CompiledAddr
addr
,
FstBuilderNode
*
node
)
{
void
fstStateCompileForAnyTrans
(
IdxFstFile
*
w
,
CompiledAddr
addr
,
FstBuilderNode
*
node
)
{
int32_t
sz
=
taosArrayGetSize
(
node
->
trans
);
assert
(
sz
<=
256
);
...
...
@@ -275,11 +275,11 @@ void fstStateCompileForAnyTrans(FstCountingWriter* w, CompiledAddr addr, FstBuil
if
(
anyOuts
)
{
if
(
FST_BUILDER_NODE_IS_FINAL
(
node
))
{
fstCountingWriter
PackUintIn
(
w
,
node
->
finalOutput
,
oSize
);
idxFile
PackUintIn
(
w
,
node
->
finalOutput
,
oSize
);
}
for
(
int32_t
i
=
sz
-
1
;
i
>=
0
;
i
--
)
{
FstTransition
*
t
=
taosArrayGet
(
node
->
trans
,
i
);
fstCountingWriter
PackUintIn
(
w
,
t
->
out
,
oSize
);
idxFile
PackUintIn
(
w
,
t
->
out
,
oSize
);
}
}
for
(
int32_t
i
=
sz
-
1
;
i
>=
0
;
i
--
)
{
...
...
@@ -288,7 +288,7 @@ void fstStateCompileForAnyTrans(FstCountingWriter* w, CompiledAddr addr, FstBuil
}
for
(
int32_t
i
=
sz
-
1
;
i
>=
0
;
i
--
)
{
FstTransition
*
t
=
taosArrayGet
(
node
->
trans
,
i
);
fstCountingWriter
Write
(
w
,
(
char
*
)
&
t
->
inp
,
1
);
idxFile
Write
(
w
,
(
char
*
)
&
t
->
inp
,
1
);
// fstPackDeltaIn(w, addr, t->addr, tSize);
}
if
(
sz
>
TRANS_INDEX_THRESHOLD
)
{
...
...
@@ -306,10 +306,10 @@ void fstStateCompileForAnyTrans(FstCountingWriter* w, CompiledAddr addr, FstBuil
index
[
t
->
inp
]
=
i
;
// fstPackDeltaIn(w, addr, t->addr, tSize);
}
fstCountingWriter
Write
(
w
,
(
char
*
)
index
,
256
);
idxFile
Write
(
w
,
(
char
*
)
index
,
256
);
taosMemoryFree
(
index
);
}
fstCountingWriter
Write
(
w
,
(
char
*
)
&
packSizes
,
1
);
idxFile
Write
(
w
,
(
char
*
)
&
packSizes
,
1
);
bool
null
=
false
;
fstStateStateNtrans
(
&
st
,
&
null
);
if
(
null
==
true
)
{
...
...
@@ -318,12 +318,12 @@ void fstStateCompileForAnyTrans(FstCountingWriter* w, CompiledAddr addr, FstBuil
// encoded in the state byte.
uint8_t
v
=
1
;
if
(
sz
==
256
)
{
fstCountingWriter
Write
(
w
,
(
char
*
)
&
v
,
1
);
idxFile
Write
(
w
,
(
char
*
)
&
v
,
1
);
}
else
{
fstCountingWriter
Write
(
w
,
(
char
*
)
&
sz
,
1
);
idxFile
Write
(
w
,
(
char
*
)
&
sz
,
1
);
}
}
fstCountingWriter
Write
(
w
,
(
char
*
)(
&
(
st
.
val
)),
1
);
idxFile
Write
(
w
,
(
char
*
)(
&
(
st
.
val
)),
1
);
return
;
}
...
...
@@ -753,7 +753,7 @@ bool fstNodeCompile(FstNode* node, void* w, CompiledAddr lastAddr, CompiledAddr
return
true
;
}
bool
fstBuilderNodeCompileTo
(
FstBuilderNode
*
b
,
FstCountingWriter
*
wrt
,
CompiledAddr
lastAddr
,
CompiledAddr
startAddr
)
{
bool
fstBuilderNodeCompileTo
(
FstBuilderNode
*
b
,
IdxFstFile
*
wrt
,
CompiledAddr
lastAddr
,
CompiledAddr
startAddr
)
{
return
fstNodeCompile
(
NULL
,
wrt
,
lastAddr
,
startAddr
,
b
);
}
...
...
@@ -763,7 +763,7 @@ FstBuilder* fstBuilderCreate(void* w, FstType ty) {
return
b
;
}
b
->
wrt
=
fstCountingWriter
Create
(
w
);
b
->
wrt
=
idxFile
Create
(
w
);
b
->
unfinished
=
fstUnFinishedNodesCreate
();
b
->
registry
=
fstRegistryCreate
(
10000
,
2
);
b
->
last
=
fstSliceCreate
(
NULL
,
0
);
...
...
@@ -773,12 +773,12 @@ FstBuilder* fstBuilderCreate(void* w, FstType ty) {
char
buf64
[
8
]
=
{
0
};
void
*
pBuf64
=
buf64
;
taosEncodeFixedU64
(
&
pBuf64
,
VERSION
);
fstCountingWriter
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
idxFile
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
pBuf64
=
buf64
;
memset
(
buf64
,
0
,
sizeof
(
buf64
));
taosEncodeFixedU64
(
&
pBuf64
,
ty
);
fstCountingWriter
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
idxFile
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
return
b
;
}
...
...
@@ -787,7 +787,7 @@ void fstBuilderDestroy(FstBuilder* b) {
return
;
}
fstCountingWriter
Destroy
(
b
->
wrt
);
idxFile
Destroy
(
b
->
wrt
);
fstUnFinishedNodesDestroy
(
b
->
unfinished
);
fstRegistryDestroy
(
b
->
registry
);
fstSliceDestroy
(
&
b
->
last
);
...
...
@@ -905,21 +905,19 @@ void* fstBuilderInsertInner(FstBuilder* b) {
void
*
pBuf64
=
buf64
;
taosEncodeFixedU64
(
&
pBuf64
,
b
->
len
);
fstCountingWriter
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
idxFile
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
pBuf64
=
buf64
;
taosEncodeFixedU64
(
&
pBuf64
,
rootAddr
);
fstCountingWriter
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
idxFile
Write
(
b
->
wrt
,
buf64
,
sizeof
(
buf64
));
char
buf32
[
4
]
=
{
0
};
void
*
pBuf32
=
buf32
;
uint32_t
sum
=
fstCountingWriter
MaskedCheckSum
(
b
->
wrt
);
uint32_t
sum
=
idxFile
MaskedCheckSum
(
b
->
wrt
);
taosEncodeFixedU32
(
&
pBuf32
,
sum
);
fstCountingWriter
Write
(
b
->
wrt
,
buf32
,
sizeof
(
buf32
));
idxFile
Write
(
b
->
wrt
,
buf32
,
sizeof
(
buf32
));
fstCountingWriterFlush
(
b
->
wrt
);
// fstCountingWriterDestroy(b->wrt);
// b->wrt = NULL;
idxFileFlush
(
b
->
wrt
);
return
b
->
wrt
;
}
void
fstBuilderFinish
(
FstBuilder
*
b
)
{
fstBuilderInsertInner
(
b
);
}
...
...
source/libs/index/src/indexFstDfa.c
浏览文件 @
ba72ce2b
...
...
@@ -61,9 +61,10 @@ void dfaBuilderDestroy(FstDfaBuilder *builder) {
pIter
=
taosHashIterate
(
builder
->
cache
,
pIter
);
}
taosHashCleanup
(
builder
->
cache
);
taosMemoryFree
(
builder
);
}
FstDfa
*
dfaBuilder
Build
(
FstDfaBuilder
*
builder
)
{
FstDfa
*
dfaBuilder
(
FstDfaBuilder
*
builder
)
{
uint32_t
sz
=
taosArrayGetSize
(
builder
->
dfa
->
insts
);
FstSparseSet
*
cur
=
sparSetCreate
(
sz
);
FstSparseSet
*
nxt
=
sparSetCreate
(
sz
);
...
...
source/libs/index/src/indexFst
CountingWriter
.c
→
source/libs/index/src/indexFst
File
.c
浏览文件 @
ba72ce2b
...
...
@@ -13,13 +13,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "indexFst
CountingWriter
.h"
#include "indexFst
File
.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#include "os.h"
#include "tutil.h"
static
int
writeCtxDoWrite
(
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
)
{
static
int
idxFileCtxDoWrite
(
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
)
{
if
(
ctx
->
type
==
TFile
)
{
assert
(
len
==
taosWriteFile
(
ctx
->
file
.
pFile
,
buf
,
len
));
}
else
{
...
...
@@ -28,7 +28,7 @@ static int writeCtxDoWrite(WriterCtx* ctx, uint8_t* buf, int len) {
ctx
->
offset
+=
len
;
return
len
;
}
static
int
writeCtxDoRead
(
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
)
{
static
int
idxFileCtxDoRead
(
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
)
{
int
nRead
=
0
;
if
(
ctx
->
type
==
TFile
)
{
#ifdef USE_MMAP
...
...
@@ -44,7 +44,7 @@ static int writeCtxDoRead(WriterCtx* ctx, uint8_t* buf, int len) {
return
nRead
;
}
static
int
writeCtxDoReadFrom
(
Writer
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
,
int32_t
offset
)
{
static
int
idxFileCtxDoReadFrom
(
IFile
Ctx
*
ctx
,
uint8_t
*
buf
,
int
len
,
int32_t
offset
)
{
int
nRead
=
0
;
if
(
ctx
->
type
==
TFile
)
{
// tfLseek(ctx->file.pFile, offset, 0);
...
...
@@ -61,7 +61,7 @@ static int writeCtxDoReadFrom(WriterCtx* ctx, uint8_t* buf, int len, int32_t off
}
return
nRead
;
}
static
int
writeCtxGetSize
(
Writer
Ctx
*
ctx
)
{
static
int
idxFileCtxGetSize
(
IFile
Ctx
*
ctx
)
{
if
(
ctx
->
type
==
TFile
)
{
int64_t
file_size
=
0
;
taosStatFile
(
ctx
->
file
.
buf
,
&
file_size
,
NULL
);
...
...
@@ -69,7 +69,7 @@ static int writeCtxGetSize(WriterCtx* ctx) {
}
return
0
;
}
static
int
writeCtxDoFlush
(
Writer
Ctx
*
ctx
)
{
static
int
idxFileCtxDoFlush
(
IFile
Ctx
*
ctx
)
{
if
(
ctx
->
type
==
TFile
)
{
// taosFsyncFile(ctx->file.pFile);
taosFsyncFile
(
ctx
->
file
.
pFile
);
...
...
@@ -80,8 +80,8 @@ static int writeCtxDoFlush(WriterCtx* ctx) {
return
1
;
}
WriterCtx
*
writer
CtxCreate
(
WriterType
type
,
const
char
*
path
,
bool
readOnly
,
int32_t
capacity
)
{
WriterCtx
*
ctx
=
taosMemoryCalloc
(
1
,
sizeof
(
Writer
Ctx
));
IFileCtx
*
idxFile
CtxCreate
(
WriterType
type
,
const
char
*
path
,
bool
readOnly
,
int32_t
capacity
)
{
IFileCtx
*
ctx
=
taosMemoryCalloc
(
1
,
sizeof
(
IFile
Ctx
));
if
(
ctx
==
NULL
)
{
return
NULL
;
}
...
...
@@ -90,39 +90,36 @@ WriterCtx* writerCtxCreate(WriterType type, const char* path, bool readOnly, int
if
(
ctx
->
type
==
TFile
)
{
// ugly code, refactor later
ctx
->
file
.
readOnly
=
readOnly
;
memcpy
(
ctx
->
file
.
buf
,
path
,
strlen
(
path
));
if
(
readOnly
==
false
)
{
// ctx->file.pFile = open(path, O_WRONLY | O_CREAT | O_APPEND, S_IRWXU | S_IRWXG | S_IRWXO);
ctx
->
file
.
pFile
=
taosOpenFile
(
path
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_APPEND
);
taosFtruncateFile
(
ctx
->
file
.
pFile
,
0
);
int64_t
file_size
;
taosStatFile
(
path
,
&
file_size
,
NULL
);
ctx
->
file
.
size
=
(
int
)
file_size
;
taosStatFile
(
path
,
&
ctx
->
file
.
size
,
NULL
);
// ctx->file.size = (int)size;
}
else
{
// ctx->file.pFile = open(path, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
ctx
->
file
.
pFile
=
taosOpenFile
(
path
,
TD_FILE_READ
);
int64_t
file_
size
=
0
;
taosFStatFile
(
ctx
->
file
.
pFile
,
&
file_
size
,
NULL
);
ctx
->
file
.
size
=
(
int
)
file_
size
;
int64_t
size
=
0
;
taosFStatFile
(
ctx
->
file
.
pFile
,
&
ctx
->
file
.
size
,
NULL
);
ctx
->
file
.
size
=
(
int
)
size
;
#ifdef USE_MMAP
ctx
->
file
.
ptr
=
(
char
*
)
tfMmapReadOnly
(
ctx
->
file
.
pFile
,
ctx
->
file
.
size
);
#endif
}
memcpy
(
ctx
->
file
.
buf
,
path
,
strlen
(
path
));
if
(
ctx
->
file
.
pFile
==
NULL
)
{
indexError
(
"failed to open file, error %d"
,
errno
);
goto
END
;
}
}
else
if
(
ctx
->
type
==
TMemory
)
{
ctx
->
mem
.
buf
=
taosMemoryCalloc
(
1
,
sizeof
(
char
)
*
capacity
);
ctx
->
mem
.
cap
a
=
capacity
;
ctx
->
mem
.
cap
=
capacity
;
}
ctx
->
write
=
writ
eCtxDoWrite
;
ctx
->
read
=
writ
eCtxDoRead
;
ctx
->
flush
=
writ
eCtxDoFlush
;
ctx
->
readFrom
=
writ
eCtxDoReadFrom
;
ctx
->
size
=
writ
eCtxGetSize
;
ctx
->
write
=
idxFil
eCtxDoWrite
;
ctx
->
read
=
idxFil
eCtxDoRead
;
ctx
->
flush
=
idxFil
eCtxDoFlush
;
ctx
->
readFrom
=
idxFil
eCtxDoReadFrom
;
ctx
->
size
=
idxFil
eCtxGetSize
;
ctx
->
offset
=
0
;
ctx
->
limit
=
capacity
;
...
...
@@ -135,7 +132,7 @@ END:
taosMemoryFree
(
ctx
);
return
NULL
;
}
void
writerCtxDestroy
(
Writer
Ctx
*
ctx
,
bool
remove
)
{
void
idxFileCtxDestroy
(
IFile
Ctx
*
ctx
,
bool
remove
)
{
if
(
ctx
->
type
==
TMemory
)
{
taosMemoryFree
(
ctx
->
mem
.
buf
);
}
else
{
...
...
@@ -149,9 +146,6 @@ void writerCtxDestroy(WriterCtx* ctx, bool remove) {
if
(
ctx
->
file
.
readOnly
==
false
)
{
int64_t
file_size
=
0
;
taosStatFile
(
ctx
->
file
.
buf
,
&
file_size
,
NULL
);
// struct stat fstat;
// stat(ctx->file.buf, &fstat);
// indexError("write file size: %d", (int)(fstat.st_size));
}
if
(
remove
)
{
unlink
(
ctx
->
file
.
buf
);
...
...
@@ -160,30 +154,29 @@ void writerCtxDestroy(WriterCtx* ctx, bool remove) {
taosMemoryFree
(
ctx
);
}
FstCountingWriter
*
fstCountingWriter
Create
(
void
*
wrt
)
{
FstCountingWriter
*
cw
=
taosMemoryCalloc
(
1
,
sizeof
(
FstCountingWriter
));
IdxFstFile
*
idxFile
Create
(
void
*
wrt
)
{
IdxFstFile
*
cw
=
taosMemoryCalloc
(
1
,
sizeof
(
IdxFstFile
));
if
(
cw
==
NULL
)
{
return
NULL
;
}
cw
->
wrt
=
wrt
;
//(void *)(writerCtxCreate(TFile, readOnly));
return
cw
;
}
void
fstCountingWriterDestroy
(
FstCountingWriter
*
cw
)
{
void
idxFileDestroy
(
IdxFstFile
*
cw
)
{
// free wrt object: close fd or free mem
fstCountingWriter
Flush
(
cw
);
//
writerCtxDestroy((Writer
Ctx *)(cw->wrt));
idxFile
Flush
(
cw
);
//
idxFileCtxDestroy((IFile
Ctx *)(cw->wrt));
taosMemoryFree
(
cw
);
}
int
fstCountingWriterWrite
(
FstCountingWriter
*
write
,
uint8_t
*
buf
,
uint32_t
len
)
{
int
idxFileWrite
(
IdxFstFile
*
write
,
uint8_t
*
buf
,
uint32_t
len
)
{
if
(
write
==
NULL
)
{
return
0
;
}
// update checksum
// write data to file/socket or mem
Writer
Ctx
*
ctx
=
write
->
wrt
;
IFile
Ctx
*
ctx
=
write
->
wrt
;
int
nWrite
=
ctx
->
write
(
ctx
,
buf
,
len
);
assert
(
nWrite
==
len
);
...
...
@@ -192,42 +185,41 @@ int fstCountingWriterWrite(FstCountingWriter* write, uint8_t* buf, uint32_t len)
write
->
summer
=
taosCalcChecksum
(
write
->
summer
,
buf
,
len
);
return
len
;
}
int
fstCountingWriterRead
(
FstCountingWriter
*
write
,
uint8_t
*
buf
,
uint32_t
len
)
{
int
idxFileRead
(
IdxFstFile
*
write
,
uint8_t
*
buf
,
uint32_t
len
)
{
if
(
write
==
NULL
)
{
return
0
;
}
Writer
Ctx
*
ctx
=
write
->
wrt
;
int
nRead
=
ctx
->
read
(
ctx
,
buf
,
len
);
IFile
Ctx
*
ctx
=
write
->
wrt
;
int
nRead
=
ctx
->
read
(
ctx
,
buf
,
len
);
// assert(nRead == len);
return
nRead
;
}
uint32_t
fstCountingWriterMaskedCheckSum
(
FstCountingWriter
*
write
)
{
uint32_t
idxFileMaskedCheckSum
(
IdxFstFile
*
write
)
{
// opt
return
write
->
summer
;
}
int
fstCountingWriterFlush
(
FstCountingWriter
*
write
)
{
Writer
Ctx
*
ctx
=
write
->
wrt
;
int
idxFileFlush
(
IdxFstFile
*
write
)
{
IFile
Ctx
*
ctx
=
write
->
wrt
;
ctx
->
flush
(
ctx
);
// write->wtr->flush
return
1
;
}
void
fstCountingWriterPackUintIn
(
FstCountingWriter
*
writer
,
uint64_t
n
,
uint8_t
nBytes
)
{
void
idxFilePackUintIn
(
IdxFstFile
*
writer
,
uint64_t
n
,
uint8_t
nBytes
)
{
assert
(
1
<=
nBytes
&&
nBytes
<=
8
);
uint8_t
*
buf
=
taosMemoryCalloc
(
8
,
sizeof
(
uint8_t
));
for
(
uint8_t
i
=
0
;
i
<
nBytes
;
i
++
)
{
buf
[
i
]
=
(
uint8_t
)
n
;
n
=
n
>>
8
;
}
fstCountingWriter
Write
(
writer
,
buf
,
nBytes
);
idxFile
Write
(
writer
,
buf
,
nBytes
);
taosMemoryFree
(
buf
);
return
;
}
uint8_t
fstCountingWriterPackUint
(
FstCountingWriter
*
writer
,
uint64_t
n
)
{
uint8_t
idxFilePackUint
(
IdxFstFile
*
writer
,
uint64_t
n
)
{
uint8_t
nBytes
=
packSize
(
n
);
fstCountingWriter
PackUintIn
(
writer
,
n
,
nBytes
);
idxFile
PackUintIn
(
writer
,
n
,
nBytes
);
return
nBytes
;
}
source/libs/index/src/indexFstNode.c
浏览文件 @
ba72ce2b
...
...
@@ -95,7 +95,7 @@ void fstBuilderNodeCloneFrom(FstBuilderNode* dst, FstBuilderNode* src) {
}
}
// bool fstBuilderNodeCompileTo(FstBuilderNode *b,
FstCountingWriter
*wrt, CompiledAddr lastAddr, CompiledAddr
// bool fstBuilderNodeCompileTo(FstBuilderNode *b,
IdxFile
*wrt, CompiledAddr lastAddr, CompiledAddr
// startAddr) {
// size_t sz = taosArrayGetSize(b->trans);
...
...
source/libs/index/src/indexFstUtil.c
浏览文件 @
ba72ce2b
...
...
@@ -75,7 +75,6 @@ CompiledAddr unpackDelta(char* data, uint64_t len, uint64_t nodeAddr) {
}
// fst slice func
//
FstSlice
fstSliceCreate
(
uint8_t
*
data
,
uint64_t
len
)
{
FstString
*
str
=
(
FstString
*
)
taosMemoryMalloc
(
sizeof
(
FstString
));
...
...
@@ -164,16 +163,3 @@ int fstSliceCompare(FstSlice* a, FstSlice* b) {
return
0
;
}
}
// FstStack* fstStackCreate(size_t elemSize, StackFreeElem freeFn) {
// FstStack *s = taosMemoryCalloc(1, sizeof(FstStack));
// if (s == NULL) { return NULL; }
// s->
// s->freeFn
//
//}
// void *fstStackPush(FstStack *s, void *elem);
// void *fstStackTop(FstStack *s);
// size_t fstStackLen(FstStack *s);
// void *fstStackGetAt(FstStack *s, size_t i);
// void fstStackDestory(FstStack *);
source/libs/index/src/indexTfile.c
浏览文件 @
ba72ce2b
...
...
@@ -16,7 +16,7 @@
#include "index.h"
#include "indexComm.h"
#include "indexFst.h"
#include "indexFst
CountingWriter
.h"
#include "indexFst
File
.h"
#include "indexUtil.h"
#include "taosdef.h"
#include "taoserror.h"
...
...
@@ -103,7 +103,7 @@ TFileCache* tfileCacheCreate(const char* path) {
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
files
);
i
++
)
{
char
*
file
=
taosArrayGetP
(
files
,
i
);
WriterCtx
*
wc
=
writer
CtxCreate
(
TFile
,
file
,
true
,
1024
*
1024
*
64
);
IFileCtx
*
wc
=
idxFile
CtxCreate
(
TFile
,
file
,
true
,
1024
*
1024
*
64
);
if
(
wc
==
NULL
)
{
indexError
(
"failed to open index:%s"
,
file
);
goto
End
;
...
...
@@ -175,7 +175,7 @@ void tfileCachePut(TFileCache* tcache, ICacheKey* key, TFileReader* reader) {
tfileReaderRef
(
reader
);
return
;
}
TFileReader
*
tfileReaderCreate
(
Writer
Ctx
*
ctx
)
{
TFileReader
*
tfileReaderCreate
(
IFile
Ctx
*
ctx
)
{
TFileReader
*
reader
=
taosMemoryCalloc
(
1
,
sizeof
(
TFileReader
));
if
(
reader
==
NULL
)
{
return
NULL
;
...
...
@@ -216,7 +216,7 @@ void tfileReaderDestroy(TFileReader* reader) {
}
else
{
indexInfo
(
"%s is not removed"
,
reader
->
ctx
->
file
.
buf
);
}
writer
CtxDestroy
(
reader
->
ctx
,
reader
->
remove
);
idxFile
CtxDestroy
(
reader
->
ctx
,
reader
->
remove
);
taosMemoryFree
(
reader
);
}
...
...
@@ -490,7 +490,7 @@ TFileWriter* tfileWriterOpen(char* path, uint64_t suid, int64_t version, const c
char
fullname
[
256
]
=
{
0
};
tfileGenFileFullName
(
fullname
,
path
,
suid
,
colName
,
version
);
// indexInfo("open write file name %s", fullname);
WriterCtx
*
wcx
=
writer
CtxCreate
(
TFile
,
fullname
,
false
,
1024
*
1024
*
64
);
IFileCtx
*
wcx
=
idxFile
CtxCreate
(
TFile
,
fullname
,
false
,
1024
*
1024
*
64
);
if
(
wcx
==
NULL
)
{
return
NULL
;
}
...
...
@@ -507,18 +507,18 @@ TFileReader* tfileReaderOpen(char* path, uint64_t suid, int64_t version, const c
char
fullname
[
256
]
=
{
0
};
tfileGenFileFullName
(
fullname
,
path
,
suid
,
colName
,
version
);
WriterCtx
*
wc
=
writer
CtxCreate
(
TFile
,
fullname
,
true
,
1024
*
1024
*
1024
);
IFileCtx
*
wc
=
idxFile
CtxCreate
(
TFile
,
fullname
,
true
,
1024
*
1024
*
1024
);
if
(
wc
==
NULL
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
indexError
(
"failed to open readonly file: %s, reason: %s"
,
fullname
,
terrstr
());
return
NULL
;
}
indexTrace
(
"open read file name:%s, file size: %
d
"
,
wc
->
file
.
buf
,
wc
->
file
.
size
);
indexTrace
(
"open read file name:%s, file size: %
"
PRId64
"
"
,
wc
->
file
.
buf
,
wc
->
file
.
size
);
TFileReader
*
reader
=
tfileReaderCreate
(
wc
);
return
reader
;
}
TFileWriter
*
tfileWriterCreate
(
Writer
Ctx
*
ctx
,
TFileHeader
*
header
)
{
TFileWriter
*
tfileWriterCreate
(
IFile
Ctx
*
ctx
,
TFileHeader
*
header
)
{
TFileWriter
*
tw
=
taosMemoryCalloc
(
1
,
sizeof
(
TFileWriter
));
if
(
tw
==
NULL
)
{
indexError
(
"index: %"
PRIu64
" failed to alloc TFilerWriter"
,
header
->
suid
);
...
...
@@ -609,14 +609,14 @@ void tfileWriterClose(TFileWriter* tw) {
if
(
tw
==
NULL
)
{
return
;
}
writer
CtxDestroy
(
tw
->
ctx
,
false
);
idxFile
CtxDestroy
(
tw
->
ctx
,
false
);
taosMemoryFree
(
tw
);
}
void
tfileWriterDestroy
(
TFileWriter
*
tw
)
{
if
(
tw
==
NULL
)
{
return
;
}
writer
CtxDestroy
(
tw
->
ctx
,
false
);
idxFile
CtxDestroy
(
tw
->
ctx
,
false
);
taosMemoryFree
(
tw
);
}
...
...
@@ -892,8 +892,8 @@ static int tfileReaderLoadHeader(TFileReader* reader) {
return
0
;
}
static
int
tfileReaderLoadFst
(
TFileReader
*
reader
)
{
Writer
Ctx
*
ctx
=
reader
->
ctx
;
int
size
=
ctx
->
size
(
ctx
);
IFile
Ctx
*
ctx
=
reader
->
ctx
;
int
size
=
ctx
->
size
(
ctx
);
// current load fst into memory, refactor it later
int
fstSize
=
size
-
reader
->
header
.
fstOffset
-
sizeof
(
tfileMagicNumber
);
...
...
@@ -905,8 +905,9 @@ static int tfileReaderLoadFst(TFileReader* reader) {
int64_t
ts
=
taosGetTimestampUs
();
int32_t
nread
=
ctx
->
readFrom
(
ctx
,
buf
,
fstSize
,
reader
->
header
.
fstOffset
);
int64_t
cost
=
taosGetTimestampUs
()
-
ts
;
indexInfo
(
"nread = %d, and fst offset=%d, fst size: %d, filename: %s, file size: %d, time cost: %"
PRId64
"us"
,
nread
,
reader
->
header
.
fstOffset
,
fstSize
,
ctx
->
file
.
buf
,
ctx
->
file
.
size
,
cost
);
indexInfo
(
"nread = %d, and fst offset=%d, fst size: %d, filename: %s, file size: %"
PRId64
", time cost: %"
PRId64
"us"
,
nread
,
reader
->
header
.
fstOffset
,
fstSize
,
ctx
->
file
.
buf
,
ctx
->
file
.
size
,
cost
);
// we assuse fst size less than FST_MAX_SIZE
assert
(
nread
>
0
&&
nread
<=
fstSize
);
...
...
@@ -919,7 +920,7 @@ static int tfileReaderLoadFst(TFileReader* reader) {
}
static
int
tfileReaderLoadTableIds
(
TFileReader
*
reader
,
int32_t
offset
,
SArray
*
result
)
{
// TODO(yihao): opt later
Writer
Ctx
*
ctx
=
reader
->
ctx
;
IFile
Ctx
*
ctx
=
reader
->
ctx
;
// add block cache
char
block
[
4096
]
=
{
0
};
int32_t
nread
=
ctx
->
readFrom
(
ctx
,
block
,
sizeof
(
block
),
offset
);
...
...
@@ -952,7 +953,7 @@ static int tfileReaderLoadTableIds(TFileReader* reader, int32_t offset, SArray*
}
static
int
tfileReaderVerify
(
TFileReader
*
reader
)
{
// just validate header and Footer, file corrupted also shuild be verified later
Writer
Ctx
*
ctx
=
reader
->
ctx
;
IFile
Ctx
*
ctx
=
reader
->
ctx
;
uint64_t
tMagicNumber
=
0
;
...
...
source/libs/index/test/fstTest.cc
浏览文件 @
ba72ce2b
...
...
@@ -7,7 +7,6 @@
#include "index.h"
#include "indexCache.h"
#include "indexFst.h"
#include "indexFstCountingWriter.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#include "indexTfile.h"
...
...
@@ -20,7 +19,7 @@ class FstWriter {
public:
FstWriter
()
{
taosRemoveFile
(
fileName
.
c_str
());
_wc
=
writer
CtxCreate
(
TFile
,
fileName
.
c_str
(),
false
,
64
*
1024
*
1024
);
_wc
=
idxFile
CtxCreate
(
TFile
,
fileName
.
c_str
(),
false
,
64
*
1024
*
1024
);
_b
=
fstBuilderCreate
(
_wc
,
0
);
}
bool
Put
(
const
std
::
string
&
key
,
uint64_t
val
)
{
...
...
@@ -38,25 +37,25 @@ class FstWriter {
fstBuilderFinish
(
_b
);
fstBuilderDestroy
(
_b
);
writer
CtxDestroy
(
_wc
,
false
);
idxFile
CtxDestroy
(
_wc
,
false
);
}
private:
FstBuilder
*
_b
;
WriterCtx
*
_wc
;
IFileCtx
*
_wc
;
};
class
FstReadMemory
{
public:
FstReadMemory
(
int32_t
size
,
const
std
::
string
&
fileName
=
TD_TMP_DIR_PATH
"tindex.tindex"
)
{
_wc
=
writer
CtxCreate
(
TFile
,
fileName
.
c_str
(),
true
,
64
*
1024
);
_w
=
fstCountingWriter
Create
(
_wc
);
_wc
=
idxFile
CtxCreate
(
TFile
,
fileName
.
c_str
(),
true
,
64
*
1024
);
_w
=
idxFile
Create
(
_wc
);
_size
=
size
;
memset
((
void
*
)
&
_s
,
0
,
sizeof
(
_s
));
}
bool
init
()
{
char
*
buf
=
(
char
*
)
taosMemoryCalloc
(
1
,
sizeof
(
char
)
*
_size
);
int
nRead
=
fstCountingWriter
Read
(
_w
,
(
uint8_t
*
)
buf
,
_size
);
int
nRead
=
idxFile
Read
(
_w
,
(
uint8_t
*
)
buf
,
_size
);
if
(
nRead
<=
0
)
{
return
false
;
}
...
...
@@ -141,18 +140,18 @@ class FstReadMemory {
}
~
FstReadMemory
()
{
fstCountingWriter
Destroy
(
_w
);
idxFile
Destroy
(
_w
);
fstDestroy
(
_fst
);
fstSliceDestroy
(
&
_s
);
writer
CtxDestroy
(
_wc
,
false
);
idxFile
CtxDestroy
(
_wc
,
false
);
}
private:
FstCountingWriter
*
_w
;
Fst
*
_fst
;
FstSlice
_s
;
WriterCtx
*
_wc
;
int32_t
_size
;
IdxFstFile
*
_w
;
Fst
*
_fst
;
FstSlice
_s
;
IFileCtx
*
_wc
;
int32_t
_size
;
};
#define L 100
...
...
source/libs/index/test/fstUT.cc
浏览文件 @
ba72ce2b
...
...
@@ -8,7 +8,6 @@
#include "index.h"
#include "indexCache.h"
#include "indexFst.h"
#include "indexFstCountingWriter.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#include "indexTfile.h"
...
...
@@ -40,7 +39,7 @@ static void EnvCleanup() {}
class
FstWriter
{
public:
FstWriter
()
{
_wc
=
writer
CtxCreate
(
TFile
,
tindex
,
false
,
64
*
1024
*
1024
);
_wc
=
idxFile
CtxCreate
(
TFile
,
tindex
,
false
,
64
*
1024
*
1024
);
_b
=
fstBuilderCreate
(
_wc
,
0
);
}
bool
Put
(
const
std
::
string
&
key
,
uint64_t
val
)
{
...
...
@@ -58,25 +57,25 @@ class FstWriter {
fstBuilderFinish
(
_b
);
fstBuilderDestroy
(
_b
);
writer
CtxDestroy
(
_wc
,
false
);
idxFile
CtxDestroy
(
_wc
,
false
);
}
private:
FstBuilder
*
_b
;
WriterCtx
*
_wc
;
IFileCtx
*
_wc
;
};
class
FstReadMemory
{
public:
FstReadMemory
(
size_t
size
)
{
_wc
=
writer
CtxCreate
(
TFile
,
tindex
,
true
,
64
*
1024
);
_w
=
fstCountingWriter
Create
(
_wc
);
_wc
=
idxFile
CtxCreate
(
TFile
,
tindex
,
true
,
64
*
1024
);
_w
=
idxFile
Create
(
_wc
);
_size
=
size
;
memset
((
void
*
)
&
_s
,
0
,
sizeof
(
_s
));
}
bool
init
()
{
char
*
buf
=
(
char
*
)
taosMemoryCalloc
(
1
,
sizeof
(
char
)
*
_size
);
int
nRead
=
fstCountingWriter
Read
(
_w
,
(
uint8_t
*
)
buf
,
_size
);
int
nRead
=
idxFile
Read
(
_w
,
(
uint8_t
*
)
buf
,
_size
);
if
(
nRead
<=
0
)
{
return
false
;
}
...
...
@@ -130,18 +129,18 @@ class FstReadMemory {
}
~
FstReadMemory
()
{
fstCountingWriter
Destroy
(
_w
);
idxFile
Destroy
(
_w
);
fstDestroy
(
_fst
);
fstSliceDestroy
(
&
_s
);
writer
CtxDestroy
(
_wc
,
false
);
idxFile
CtxDestroy
(
_wc
,
false
);
}
private:
FstCountingWriter
*
_w
;
Fst
*
_fst
;
FstSlice
_s
;
WriterCtx
*
_wc
;
size_t
_size
;
IdxFstFile
*
_w
;
Fst
*
_fst
;
FstSlice
_s
;
IFileCtx
*
_wc
;
size_t
_size
;
};
class
FstWriterEnv
:
public
::
testing
::
Test
{
...
...
source/libs/index/test/indexTests.cc
浏览文件 @
ba72ce2b
...
...
@@ -20,7 +20,6 @@
#include "index.h"
#include "indexCache.h"
#include "indexFst.h"
#include "indexFstCountingWriter.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#include "indexTfile.h"
...
...
@@ -51,7 +50,7 @@ class DebugInfo {
class
FstWriter
{
public:
FstWriter
()
{
_wc
=
writer
CtxCreate
(
TFile
,
TD_TMP_DIR_PATH
"tindex"
,
false
,
64
*
1024
*
1024
);
_wc
=
idxFile
CtxCreate
(
TFile
,
TD_TMP_DIR_PATH
"tindex"
,
false
,
64
*
1024
*
1024
);
_b
=
fstBuilderCreate
(
NULL
,
0
);
}
bool
Put
(
const
std
::
string
&
key
,
uint64_t
val
)
{
...
...
@@ -64,25 +63,25 @@ class FstWriter {
fstBuilderFinish
(
_b
);
fstBuilderDestroy
(
_b
);
writer
CtxDestroy
(
_wc
,
false
);
idxFile
CtxDestroy
(
_wc
,
false
);
}
private:
FstBuilder
*
_b
;
WriterCtx
*
_wc
;
IFileCtx
*
_wc
;
};
class
FstReadMemory
{
public:
FstReadMemory
(
size_t
size
)
{
_wc
=
writer
CtxCreate
(
TFile
,
TD_TMP_DIR_PATH
"tindex"
,
true
,
64
*
1024
);
_w
=
fstCountingWriter
Create
(
_wc
);
_wc
=
idxFile
CtxCreate
(
TFile
,
TD_TMP_DIR_PATH
"tindex"
,
true
,
64
*
1024
);
_w
=
idxFile
Create
(
_wc
);
_size
=
size
;
memset
((
void
*
)
&
_s
,
0
,
sizeof
(
_s
));
}
bool
init
()
{
char
*
buf
=
(
char
*
)
taosMemoryCalloc
(
1
,
sizeof
(
char
)
*
_size
);
int
nRead
=
fstCountingWriter
Read
(
_w
,
(
uint8_t
*
)
buf
,
_size
);
int
nRead
=
idxFile
Read
(
_w
,
(
uint8_t
*
)
buf
,
_size
);
if
(
nRead
<=
0
)
{
return
false
;
}
...
...
@@ -124,18 +123,18 @@ class FstReadMemory {
}
~
FstReadMemory
()
{
fstCountingWriter
Destroy
(
_w
);
idxFile
Destroy
(
_w
);
fstDestroy
(
_fst
);
fstSliceDestroy
(
&
_s
);
writer
CtxDestroy
(
_wc
,
true
);
idxFile
CtxDestroy
(
_wc
,
true
);
}
private:
FstCountingWriter
*
_w
;
Fst
*
_fst
;
FstSlice
_s
;
WriterCtx
*
_wc
;
size_t
_size
;
IdxFstFile
*
_w
;
Fst
*
_fst
;
FstSlice
_s
;
IFileCtx
*
_wc
;
size_t
_size
;
};
#define L 100
...
...
@@ -392,13 +391,13 @@ class TFileObj {
fileName_
=
path
;
WriterCtx
*
ctx
=
writer
CtxCreate
(
TFile
,
path
.
c_str
(),
false
,
64
*
1024
*
1024
);
IFileCtx
*
ctx
=
idxFile
CtxCreate
(
TFile
,
path
.
c_str
(),
false
,
64
*
1024
*
1024
);
writer_
=
tfileWriterCreate
(
ctx
,
&
header
);
return
writer_
!=
NULL
?
true
:
false
;
}
bool
InitReader
()
{
WriterCtx
*
ctx
=
writer
CtxCreate
(
TFile
,
fileName_
.
c_str
(),
true
,
64
*
1024
*
1024
);
IFileCtx
*
ctx
=
idxFile
CtxCreate
(
TFile
,
fileName_
.
c_str
(),
true
,
64
*
1024
*
1024
);
reader_
=
tfileReaderCreate
(
ctx
);
return
reader_
!=
NULL
?
true
:
false
;
}
...
...
source/libs/index/test/jsonUT.cc
浏览文件 @
ba72ce2b
...
...
@@ -7,7 +7,6 @@
#include "index.h"
#include "indexCache.h"
#include "indexFst.h"
#include "indexFstCountingWriter.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#include "indexTfile.h"
...
...
source/libs/index/test/utilUT.cc
浏览文件 @
ba72ce2b
...
...
@@ -8,7 +8,6 @@
#include "indexCache.h"
#include "indexComm.h"
#include "indexFst.h"
#include "indexFstCountingWriter.h"
#include "indexFstUtil.h"
#include "indexInt.h"
#include "indexTfile.h"
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
ba72ce2b
...
...
@@ -19,8 +19,8 @@
#include "querynodes.h"
#include "taos.h"
#include "taoserror.h"
#include "thash.h"
#include "tdatablock.h"
#include "thash.h"
static
SNode
*
makeNode
(
ENodeType
type
,
size_t
size
)
{
SNode
*
p
=
taosMemoryCalloc
(
1
,
size
);
...
...
@@ -1497,13 +1497,18 @@ typedef struct SCollectFuncsCxt {
int32_t
errCode
;
FFuncClassifier
classifier
;
SNodeList
*
pFuncs
;
SHashObj
*
pAliasName
;
}
SCollectFuncsCxt
;
static
EDealRes
collectFuncs
(
SNode
*
pNode
,
void
*
pContext
)
{
SCollectFuncsCxt
*
pCxt
=
(
SCollectFuncsCxt
*
)
pContext
;
if
(
QUERY_NODE_FUNCTION
==
nodeType
(
pNode
)
&&
pCxt
->
classifier
(((
SFunctionNode
*
)
pNode
)
->
funcId
)
&&
!
(((
SExprNode
*
)
pNode
)
->
orderAlias
))
{
pCxt
->
errCode
=
nodesListStrictAppend
(
pCxt
->
pFuncs
,
nodesCloneNode
(
pNode
));
SExprNode
*
pExpr
=
(
SExprNode
*
)
pNode
;
if
(
NULL
==
taosHashGet
(
pCxt
->
pAliasName
,
pExpr
->
aliasName
,
strlen
(
pExpr
->
aliasName
)))
{
pCxt
->
errCode
=
nodesListStrictAppend
(
pCxt
->
pFuncs
,
nodesCloneNode
(
pNode
));
taosHashPut
(
pCxt
->
pAliasName
,
pExpr
->
aliasName
,
strlen
(
pExpr
->
aliasName
),
&
pExpr
,
POINTER_BYTES
);
}
return
(
TSDB_CODE_SUCCESS
==
pCxt
->
errCode
?
DEAL_RES_IGNORE_CHILD
:
DEAL_RES_ERROR
);
}
return
DEAL_RES_CONTINUE
;
...
...
@@ -1515,23 +1520,27 @@ int32_t nodesCollectFuncs(SSelectStmt* pSelect, ESqlClause clause, FFuncClassifi
}
SCollectFuncsCxt
cxt
=
{
.
errCode
=
TSDB_CODE_SUCCESS
,
.
classifier
=
classifier
,
.
pFuncs
=
(
NULL
==
*
pFuncs
?
nodesMakeList
()
:
*
pFuncs
)};
.
errCode
=
TSDB_CODE_SUCCESS
,
.
classifier
=
classifier
,
.
pFuncs
=
(
NULL
==
*
pFuncs
?
nodesMakeList
()
:
*
pFuncs
),
.
pAliasName
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_VARCHAR
),
false
,
false
)};
if
(
NULL
==
cxt
.
pFuncs
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
*
pFuncs
=
NULL
;
nodesWalkSelectStmt
(
pSelect
,
clause
,
collectFuncs
,
&
cxt
);
if
(
TSDB_CODE_SUCCESS
!
=
cxt
.
errCode
)
{
nodesDestroyList
(
cxt
.
pFuncs
);
return
cxt
.
errCode
;
}
if
(
LIST_LENGTH
(
cxt
.
pFuncs
)
>
0
)
{
*
pFuncs
=
cxt
.
pFuncs
;
if
(
TSDB_CODE_SUCCESS
=
=
cxt
.
errCode
)
{
if
(
LIST_LENGTH
(
cxt
.
pFuncs
)
>
0
)
{
*
pFuncs
=
cxt
.
pFuncs
;
}
else
{
nodesDestroyList
(
cxt
.
pFuncs
);
}
}
else
{
nodesDestroyList
(
cxt
.
pFuncs
);
}
taosHashCleanup
(
cxt
.
pAliasName
);
return
TSDB_CODE_SUCCESS
;
return
cxt
.
errCode
;
}
typedef
struct
SCollectSpecialNodesCxt
{
...
...
source/libs/parser/inc/parAst.h
浏览文件 @
ba72ce2b
...
...
@@ -154,6 +154,7 @@ SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_
SNode
*
createAlterTableRenameCol
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
int8_t
alterType
,
SToken
*
pOldColName
,
SToken
*
pNewColName
);
SNode
*
createAlterTableSetTag
(
SAstCreateContext
*
pCxt
,
SNode
*
pRealTable
,
SToken
*
pTagName
,
SNode
*
pVal
);
SNode
*
setAlterSuperTableType
(
SNode
*
pStmt
);
SNode
*
createUseDatabaseStmt
(
SAstCreateContext
*
pCxt
,
SToken
*
pDbName
);
SNode
*
createShowStmt
(
SAstCreateContext
*
pCxt
,
ENodeType
type
);
SNode
*
createShowStmtWithCond
(
SAstCreateContext
*
pCxt
,
ENodeType
type
,
SNode
*
pDbName
,
SNode
*
pTbName
,
...
...
source/libs/parser/inc/parUtil.h
浏览文件 @
ba72ce2b
...
...
@@ -53,6 +53,7 @@ typedef struct SParseMetaCache {
}
SParseMetaCache
;
int32_t
generateSyntaxErrMsg
(
SMsgBuf
*
pBuf
,
int32_t
errCode
,
...);
int32_t
generateSyntaxErrMsgExt
(
SMsgBuf
*
pBuf
,
int32_t
errCode
,
const
char
*
pFormat
,
...);
int32_t
buildInvalidOperationMsg
(
SMsgBuf
*
pMsgBuf
,
const
char
*
msg
);
int32_t
buildSyntaxErrMsg
(
SMsgBuf
*
pBuf
,
const
char
*
additionalInfo
,
const
char
*
sourceStr
);
...
...
source/libs/parser/inc/sql.y
浏览文件 @
ba72ce2b
...
...
@@ -232,7 +232,7 @@ cmd ::= DROP TABLE multi_drop_clause(A).
cmd ::= DROP STABLE exists_opt(A) full_table_name(B). { pCxt->pRootNode = createDropSuperTableStmt(pCxt, A, B); }
cmd ::= ALTER TABLE alter_table_clause(A). { pCxt->pRootNode = A; }
cmd ::= ALTER STABLE alter_table_clause(A). { pCxt->pRootNode =
A
; }
cmd ::= ALTER STABLE alter_table_clause(A). { pCxt->pRootNode =
setAlterSuperTableType(A)
; }
alter_table_clause(A) ::= full_table_name(B) alter_table_options(C). { A = createAlterTableModifyOptions(pCxt, B, C); }
alter_table_clause(A) ::=
...
...
@@ -259,7 +259,7 @@ multi_create_clause(A) ::= multi_create_clause(B) create_subtable_clause(C).
create_subtable_clause(A) ::=
not_exists_opt(B) full_table_name(C) USING full_table_name(D)
specific_tags_opt(E) TAGS NK_LP
literal_list(F) NK_RP table_options(G).
{ A = createCreateSubTableClause(pCxt, B, C, D, E, F, G); }
specific_tags_opt(E) TAGS NK_LP
expression_list(F) NK_RP table_options(G).
{ A = createCreateSubTableClause(pCxt, B, C, D, E, F, G); }
%type multi_drop_clause { SNodeList* }
%destructor multi_drop_clause { nodesDestroyList($$); }
...
...
source/libs/parser/src/parAstCreater.c
浏览文件 @
ba72ce2b
...
...
@@ -1127,6 +1127,11 @@ SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, SToken
return
createAlterTableStmtFinalize
(
pRealTable
,
pStmt
);
}
SNode
*
setAlterSuperTableType
(
SNode
*
pStmt
)
{
setNodeType
(
pStmt
,
QUERY_NODE_ALTER_SUPER_TABLE_STMT
);
return
pStmt
;
}
SNode
*
createUseDatabaseStmt
(
SAstCreateContext
*
pCxt
,
SToken
*
pDbName
)
{
CHECK_PARSER_STATUS
(
pCxt
);
if
(
!
checkDbName
(
pCxt
,
pDbName
,
false
))
{
...
...
source/libs/parser/src/parAstParser.c
浏览文件 @
ba72ce2b
...
...
@@ -247,6 +247,10 @@ static int32_t collectMetaKeyFromAlterTable(SCollectMetaKeyCxt* pCxt, SAlterTabl
return
code
;
}
static
int32_t
collectMetaKeyFromAlterStable
(
SCollectMetaKeyCxt
*
pCxt
,
SAlterTableStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromUseDatabase
(
SCollectMetaKeyCxt
*
pCxt
,
SUseDatabaseStmt
*
pStmt
)
{
return
reserveDbVgVersionInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pCxt
->
pMetaCache
);
}
...
...
@@ -483,6 +487,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
return
collectMetaKeyFromDropTable
(
pCxt
,
(
SDropTableStmt
*
)
pStmt
);
case
QUERY_NODE_ALTER_TABLE_STMT
:
return
collectMetaKeyFromAlterTable
(
pCxt
,
(
SAlterTableStmt
*
)
pStmt
);
case
QUERY_NODE_ALTER_SUPER_TABLE_STMT
:
return
collectMetaKeyFromAlterStable
(
pCxt
,
(
SAlterTableStmt
*
)
pStmt
);
case
QUERY_NODE_USE_DATABASE_STMT
:
return
collectMetaKeyFromUseDatabase
(
pCxt
,
(
SUseDatabaseStmt
*
)
pStmt
);
case
QUERY_NODE_CREATE_INDEX_STMT
:
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
ba72ce2b
...
...
@@ -48,6 +48,12 @@
pSql += sToken.n; \
} while (TK_NK_SPACE == sToken.type)
typedef
struct
SInsertParseBaseContext
{
SParseContext
*
pComCxt
;
char
*
pSql
;
SMsgBuf
msg
;
}
SInsertParseBaseContext
;
typedef
struct
SInsertParseContext
{
SParseContext
*
pComCxt
;
// input
char
*
pSql
;
// input
...
...
@@ -1105,6 +1111,32 @@ static int32_t storeTableMeta(SInsertParseContext* pCxt, SHashObj* pHash, SName*
return
taosHashPut
(
pHash
,
pName
,
len
,
&
pBackup
,
POINTER_BYTES
);
}
static
int32_t
skipParentheses
(
SInsertParseSyntaxCxt
*
pCxt
)
{
SToken
sToken
;
int32_t
expectRightParenthesis
=
1
;
while
(
1
)
{
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
if
(
TK_NK_LP
==
sToken
.
type
)
{
++
expectRightParenthesis
;
}
else
if
(
TK_NK_RP
==
sToken
.
type
&&
0
==
--
expectRightParenthesis
)
{
break
;
}
if
(
0
==
sToken
.
n
)
{
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
") expected"
,
NULL
);
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
skipBoundColumns
(
SInsertParseSyntaxCxt
*
pCxt
)
{
return
skipParentheses
(
pCxt
);
}
static
int32_t
ignoreBoundColumns
(
SInsertParseContext
*
pCxt
)
{
SInsertParseSyntaxCxt
cxt
=
{.
pComCxt
=
pCxt
->
pComCxt
,
.
pSql
=
pCxt
->
pSql
,
.
msg
=
pCxt
->
msg
,
.
pMetaCache
=
NULL
};
int32_t
code
=
skipBoundColumns
(
&
cxt
);
pCxt
->
pSql
=
cxt
.
pSql
;
return
code
;
}
static
int32_t
skipUsingClause
(
SInsertParseSyntaxCxt
*
pCxt
);
// pSql -> stb_name [(tag1_name, ...)] TAGS (tag1_value, ...)
...
...
@@ -1453,12 +1485,29 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
tNameGetFullDbName
(
&
name
,
dbFName
);
CHECK_CODE
(
taosHashPut
(
pCxt
->
pDbFNameHashObj
,
dbFName
,
strlen
(
dbFName
),
dbFName
,
sizeof
(
dbFName
)));
bool
existedUsing
=
false
;
// USING clause
if
(
TK_USING
==
sToken
.
type
)
{
existedUsing
=
true
;
CHECK_CODE
(
parseUsingClause
(
pCxt
,
&
name
,
tbFName
));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
autoCreateTbl
=
true
;
}
else
{
}
char
*
pBoundColsStart
=
NULL
;
if
(
TK_NK_LP
==
sToken
.
type
)
{
// pSql -> field1_name, ...)
pBoundColsStart
=
pCxt
->
pSql
;
CHECK_CODE
(
ignoreBoundColumns
(
pCxt
));
// CHECK_CODE(parseBoundColumns(pCxt, &dataBuf->boundColumnInfo, getTableColumnSchema(pCxt->pTableMeta)));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
}
if
(
TK_USING
==
sToken
.
type
)
{
CHECK_CODE
(
parseUsingClause
(
pCxt
,
&
name
,
tbFName
));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
autoCreateTbl
=
true
;
}
else
if
(
!
existedUsing
)
{
CHECK_CODE
(
getTableMeta
(
pCxt
,
&
name
,
dbFName
));
}
...
...
@@ -1467,10 +1516,11 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
sizeof
(
SSubmitBlk
),
getTableInfo
(
pCxt
->
pTableMeta
).
rowSize
,
pCxt
->
pTableMeta
,
&
dataBuf
,
NULL
,
&
pCxt
->
createTblReq
));
if
(
TK_NK_LP
==
sToken
.
type
)
{
// pSql -> field1_name, ...)
if
(
NULL
!=
pBoundColsStart
)
{
char
*
pCurrPos
=
pCxt
->
pSql
;
pCxt
->
pSql
=
pBoundColsStart
;
CHECK_CODE
(
parseBoundColumns
(
pCxt
,
&
dataBuf
->
boundColumnInfo
,
getTableColumnSchema
(
pCxt
->
pTableMeta
)));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
)
;
pCxt
->
pSql
=
pCurrPos
;
}
if
(
TK_VALUES
==
sToken
.
type
)
{
...
...
@@ -1610,25 +1660,6 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery, SParseMetaCache
return
code
;
}
static
int32_t
skipParentheses
(
SInsertParseSyntaxCxt
*
pCxt
)
{
SToken
sToken
;
int32_t
expectRightParenthesis
=
1
;
while
(
1
)
{
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
if
(
TK_NK_LP
==
sToken
.
type
)
{
++
expectRightParenthesis
;
}
else
if
(
TK_NK_RP
==
sToken
.
type
&&
0
==
--
expectRightParenthesis
)
{
break
;
}
if
(
0
==
sToken
.
n
)
{
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
") expected"
,
NULL
);
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
skipBoundColumns
(
SInsertParseSyntaxCxt
*
pCxt
)
{
return
skipParentheses
(
pCxt
);
}
// pSql -> (field1_value, ...) [(field1_value2, ...) ...]
static
int32_t
skipValuesClause
(
SInsertParseSyntaxCxt
*
pCxt
)
{
int32_t
numOfRows
=
0
;
...
...
@@ -1717,15 +1748,15 @@ static int32_t parseInsertBodySyntax(SInsertParseSyntaxCxt* pCxt) {
SToken
tbnameToken
=
sToken
;
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
bool
existedUsing
=
false
;
// USING clause
if
(
TK_USING
==
sToken
.
type
)
{
existedUsing
=
true
;
CHECK_CODE
(
collectAutoCreateTableMetaKey
(
pCxt
,
&
tbnameToken
));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
CHECK_CODE
(
collectTableMetaKey
(
pCxt
,
&
sToken
));
CHECK_CODE
(
skipUsingClause
(
pCxt
));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
}
else
{
CHECK_CODE
(
collectTableMetaKey
(
pCxt
,
&
tbnameToken
));
}
if
(
TK_NK_LP
==
sToken
.
type
)
{
...
...
@@ -1734,6 +1765,17 @@ static int32_t parseInsertBodySyntax(SInsertParseSyntaxCxt* pCxt) {
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
}
if
(
TK_USING
==
sToken
.
type
&&
!
existedUsing
)
{
existedUsing
=
true
;
CHECK_CODE
(
collectAutoCreateTableMetaKey
(
pCxt
,
&
tbnameToken
));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
CHECK_CODE
(
collectTableMetaKey
(
pCxt
,
&
sToken
));
CHECK_CODE
(
skipUsingClause
(
pCxt
));
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
}
else
{
CHECK_CODE
(
collectTableMetaKey
(
pCxt
,
&
tbnameToken
));
}
if
(
TK_VALUES
==
sToken
.
type
)
{
// pSql -> (field1_value, ...) [(field1_value2, ...) ...]
CHECK_CODE
(
skipValuesClause
(
pCxt
));
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
ba72ce2b
...
...
@@ -121,8 +121,8 @@ static int32_t getTableMetaImpl(STranslateContext* pCxt, const SName* pName, STa
}
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"
catalogGetTableMeta error, code:%s, dbName:%s, tbName:%s"
,
tstrerror
(
code
),
pName
->
dbname
,
pName
->
tname
);
parserError
(
"
0x%"
PRIx64
" catalogGetTableMeta error, code:%s, dbName:%s, tbName:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pName
->
dbname
,
pName
->
tname
);
}
return
code
;
}
...
...
@@ -150,8 +150,8 @@ static int32_t getTableCfg(STranslateContext* pCxt, const SName* pName, STableCf
}
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"
catalogRefreshGetTableCfg error, code:%s, dbName:%s, tbName:%s"
,
tstrerror
(
code
),
pName
->
dbname
,
pName
->
tname
);
parserError
(
"
0x%"
PRIx64
" catalogRefreshGetTableCfg error, code:%s, dbName:%s, tbName:%s"
,
p
Cxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pName
->
dbname
,
p
Name
->
tname
);
}
return
code
;
}
...
...
@@ -173,8 +173,8 @@ static int32_t refreshGetTableMeta(STranslateContext* pCxt, const char* pDbName,
code
=
catalogRefreshGetTableMeta
(
pParCxt
->
pCatalog
,
&
conn
,
&
name
,
pMeta
,
false
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"
catalogRefreshGetTableMeta error, code:%s, dbName:%s, tbName:%s"
,
tstrerror
(
code
),
pDbName
,
pTableName
);
parserError
(
"
0x%"
PRIx64
" catalogRefreshGetTableMeta error, code:%s, dbName:%s, tbName:%s"
,
p
Cxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pDbName
,
p
TableName
);
}
return
code
;
}
...
...
@@ -196,7 +196,8 @@ static int32_t getDBVgInfoImpl(STranslateContext* pCxt, const SName* pName, SArr
}
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"catalogGetDBVgInfo error, code:%s, dbFName:%s"
,
tstrerror
(
code
),
fullDbName
);
parserError
(
"0x%"
PRIx64
" catalogGetDBVgInfo error, code:%s, dbFName:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
fullDbName
);
}
return
code
;
}
...
...
@@ -227,8 +228,8 @@ static int32_t getTableHashVgroupImpl(STranslateContext* pCxt, const SName* pNam
}
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"
catalogGetTableHashVgroup error, code:%s, dbName:%s, tbName:%s"
,
tstrerror
(
code
),
pName
->
dbname
,
pName
->
tname
);
parserError
(
"
0x%"
PRIx64
" catalogGetTableHashVgroup error, code:%s, dbName:%s, tbName:%s"
,
p
Cxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pName
->
dbname
,
p
Name
->
tname
);
}
return
code
;
}
...
...
@@ -251,7 +252,8 @@ static int32_t getDBVgVersion(STranslateContext* pCxt, const char* pDbFName, int
}
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"catalogGetDBVgVersion error, code:%s, dbFName:%s"
,
tstrerror
(
code
),
pDbFName
);
parserError
(
"0x%"
PRIx64
" catalogGetDBVgVersion error, code:%s, dbFName:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pDbFName
);
}
return
code
;
}
...
...
@@ -276,7 +278,8 @@ static int32_t getDBCfg(STranslateContext* pCxt, const char* pDbName, SDbCfgInfo
}
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"catalogGetDBCfg error, code:%s, dbFName:%s"
,
tstrerror
(
code
),
dbFname
);
parserError
(
"0x%"
PRIx64
" catalogGetDBCfg error, code:%s, dbFName:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
dbFname
);
}
return
code
;
}
...
...
@@ -303,6 +306,10 @@ static int32_t getUdfInfo(STranslateContext* pCxt, SFunctionNode* pFunc) {
pFunc
->
udfBufSize
=
funcInfo
.
bufSize
;
tFreeSFuncInfo
(
&
funcInfo
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"0x%"
PRIx64
" catalogGetUdfInfo error, code:%s, funcName:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pFunc
->
functionName
);
}
return
code
;
}
...
...
@@ -323,7 +330,8 @@ static int32_t getTableIndex(STranslateContext* pCxt, const SName* pName, SArray
code
=
catalogGetTableIndex
(
pParCxt
->
pCatalog
,
&
conn
,
pName
,
pIndexes
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"getTableIndex error, code:%s, dbName:%s, tbName:%s"
,
tstrerror
(
code
),
pName
->
dbname
,
pName
->
tname
);
parserError
(
"0x%"
PRIx64
" getTableIndex error, code:%s, dbName:%s, tbName:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
),
pName
->
dbname
,
pName
->
tname
);
}
return
code
;
}
...
...
@@ -341,7 +349,7 @@ static int32_t getDnodeList(STranslateContext* pCxt, SArray** pDnodes) {
code
=
catalogGetDnodeList
(
pParCxt
->
pCatalog
,
&
conn
,
pDnodes
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
parserError
(
"
getDnodeList error, code:%s"
,
tstrerror
(
code
));
parserError
(
"
0x%"
PRIx64
" getDnodeList error, code:%s"
,
pCxt
->
pParseCxt
->
requestId
,
tstrerror
(
code
));
}
return
code
;
}
...
...
@@ -707,7 +715,7 @@ static EDealRes translateColumnUseAlias(STranslateContext* pCxt, SColumnNode** p
}
static
EDealRes
translateColumn
(
STranslateContext
*
pCxt
,
SColumnNode
**
pCol
)
{
if
(
isSelectStmt
(
pCxt
->
pCurrStmt
)
&&
NULL
==
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pFromTable
)
{
if
(
NULL
==
pCxt
->
pCurrStmt
||
isSelectStmt
(
pCxt
->
pCurrStmt
)
&&
NULL
==
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pFromTable
)
{
return
generateDealNodeErrMsg
(
pCxt
,
TSDB_CODE_PAR_INVALID_COLUMN
,
(
*
pCol
)
->
colName
);
}
...
...
@@ -1248,6 +1256,22 @@ static int32_t translateForbidGroupByFunc(STranslateContext* pCxt, SFunctionNode
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateRepeatScanFunc
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
)
{
if
(
!
fmIsRepeatScanFunc
(
pFunc
->
funcId
))
{
return
TSDB_CODE_SUCCESS
;
}
if
(
isSelectStmt
(
pCxt
->
pCurrStmt
)
&&
NULL
!=
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pFromTable
)
{
SNode
*
pTable
=
((
SSelectStmt
*
)
pCxt
->
pCurrStmt
)
->
pFromTable
;
if
(
QUERY_NODE_REAL_TABLE
==
nodeType
(
pTable
)
&&
(
TSDB_CHILD_TABLE
==
((
SRealTableNode
*
)
pTable
)
->
pMeta
->
tableType
||
TSDB_NORMAL_TABLE
==
((
SRealTableNode
*
)
pTable
)
->
pMeta
->
tableType
))
{
return
TSDB_CODE_SUCCESS
;
}
}
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE
,
"%s is only supported in single table query"
,
pFunc
->
functionName
);
}
static
void
setFuncClassification
(
SNode
*
pCurrStmt
,
SFunctionNode
*
pFunc
)
{
if
(
NULL
!=
pCurrStmt
&&
QUERY_NODE_SELECT_STMT
==
nodeType
(
pCurrStmt
))
{
SSelectStmt
*
pSelect
=
(
SSelectStmt
*
)
pCurrStmt
;
...
...
@@ -1370,6 +1394,9 @@ static int32_t translateNoramlFunction(STranslateContext* pCxt, SFunctionNode* p
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateForbidGroupByFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateRepeatScanFunc
(
pCxt
,
pFunc
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
setFuncClassification
(
pCxt
->
pCurrStmt
,
pFunc
);
}
...
...
@@ -2760,6 +2787,7 @@ static int32_t translateDeleteWhere(STranslateContext* pCxt, SDeleteStmt* pDelet
}
static
int32_t
translateDelete
(
STranslateContext
*
pCxt
,
SDeleteStmt
*
pDelete
)
{
pCxt
->
pCurrStmt
=
(
SNode
*
)
pDelete
;
int32_t
code
=
translateFrom
(
pCxt
,
pDelete
->
pFromTable
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateDeleteWhere
(
pCxt
,
pDelete
);
...
...
@@ -3743,12 +3771,24 @@ static int32_t buildAlterSuperTableReq(STranslateContext* pCxt, SAlterTableStmt*
return
TSDB_CODE_SUCCESS
;
}
static
SSchema
*
getColSchema
(
STableMeta
*
pTableMeta
,
const
char
*
p
Tag
Name
)
{
static
SSchema
*
getColSchema
(
STableMeta
*
pTableMeta
,
const
char
*
p
Col
Name
)
{
int32_t
numOfFields
=
getNumOfTags
(
pTableMeta
)
+
getNumOfColumns
(
pTableMeta
);
for
(
int32_t
i
=
0
;
i
<
numOfFields
;
++
i
)
{
SSchema
*
pTagSchema
=
pTableMeta
->
schema
+
i
;
if
(
0
==
strcmp
(
pTagName
,
pTagSchema
->
name
))
{
return
pTagSchema
;
SSchema
*
pSchema
=
pTableMeta
->
schema
+
i
;
if
(
0
==
strcmp
(
pColName
,
pSchema
->
name
))
{
return
pSchema
;
}
}
return
NULL
;
}
static
SSchema
*
getTagSchema
(
STableMeta
*
pTableMeta
,
const
char
*
pTagName
)
{
int32_t
numOfTags
=
getNumOfTags
(
pTableMeta
);
SSchema
*
pTagsSchema
=
getTableTagSchema
(
pTableMeta
);
for
(
int32_t
i
=
0
;
i
<
numOfTags
;
++
i
)
{
SSchema
*
pSchema
=
pTagsSchema
+
i
;
if
(
0
==
strcmp
(
pTagName
,
pSchema
->
name
))
{
return
pSchema
;
}
}
return
NULL
;
...
...
@@ -3756,22 +3796,48 @@ static SSchema* getColSchema(STableMeta* pTableMeta, const char* pTagName) {
static
int32_t
checkAlterSuperTable
(
STranslateContext
*
pCxt
,
SAlterTableStmt
*
pStmt
)
{
if
(
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
==
pStmt
->
alterType
||
TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME
==
pStmt
->
alterType
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
,
"Set tag value only available for child table"
);
}
if
(
pStmt
->
alterType
==
TSDB_ALTER_TABLE_UPDATE_OPTIONS
&&
-
1
!=
pStmt
->
pOptions
->
ttl
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
);
}
if
(
pStmt
->
dataType
.
type
==
TSDB_DATA_TYPE_JSON
&&
pStmt
->
alterType
==
TSDB_ALTER_TABLE_ADD_TAG
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_ONE_JSON_TAG
);
}
if
(
pStmt
->
dataType
.
type
==
TSDB_DATA_TYPE_JSON
&&
pStmt
->
alterType
==
TSDB_ALTER_TABLE_ADD_COLUMN
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_COL_JSON
);
}
STableMeta
*
pTableMeta
=
NULL
;
int32_t
code
=
getTableMeta
(
pCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
pTableMeta
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
return
code
;
}
SSchema
*
pTagsSchema
=
getTableTagSchema
(
pTableMeta
);
if
(
getNumOfTags
(
pTableMeta
)
==
1
&&
pTagsSchema
->
type
==
TSDB_DATA_TYPE_JSON
&&
(
pStmt
->
alterType
==
TSDB_ALTER_TABLE_ADD_TAG
||
pStmt
->
alterType
==
TSDB_ALTER_TABLE_DROP_TAG
||
pStmt
->
alterType
==
TSDB_ALTER_TABLE_UPDATE_TAG_BYTES
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_ONE_JSON_TAG
);
}
if
(
TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES
==
pStmt
->
alterType
||
TSDB_ALTER_TABLE_UPDATE_TAG_BYTES
==
pStmt
->
alterType
)
{
STableMeta
*
pTableMeta
=
NULL
;
int32_t
code
=
getTableMeta
(
pCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
pTableMeta
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SSchema
*
pSchema
=
getColSchema
(
pTableMeta
,
pStmt
->
colName
);
if
(
NULL
==
pSchema
)
{
code
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_COLUMN
,
pStmt
->
colName
);
}
else
if
(
!
IS_VAR_DATA_TYPE
(
pSchema
->
type
)
||
pSchema
->
type
!=
pStmt
->
dataType
.
type
||
pSchema
->
bytes
>=
calcTypeBytes
(
pStmt
->
dataType
))
{
code
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_MODIFY_COL
);
}
if
(
TSDB_SUPER_TABLE
!=
pTableMeta
->
tableType
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
,
"Table is not super table"
);
}
SSchema
*
pSchema
=
getColSchema
(
pTableMeta
,
pStmt
->
colName
);
if
(
NULL
==
pSchema
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_COLUMN
,
pStmt
->
colName
);
}
else
if
(
!
IS_VAR_DATA_TYPE
(
pSchema
->
type
)
||
pSchema
->
type
!=
pStmt
->
dataType
.
type
||
pSchema
->
bytes
>=
calcTypeBytes
(
pStmt
->
dataType
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_MODIFY_COL
);
}
return
code
;
}
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -4455,6 +4521,7 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
code
=
translateDropSuperTable
(
pCxt
,
(
SDropSuperTableStmt
*
)
pNode
);
break
;
case
QUERY_NODE_ALTER_TABLE_STMT
:
case
QUERY_NODE_ALTER_SUPER_TABLE_STMT
:
code
=
translateAlterSuperTable
(
pCxt
,
(
SAlterTableStmt
*
)
pNode
);
break
;
case
QUERY_NODE_CREATE_USER_STMT
:
...
...
@@ -5222,30 +5289,62 @@ static void addCreateTbReqIntoVgroup(int32_t acctId, SHashObj* pVgroupHashmap, S
}
}
static
int32_t
createValueFromFunction
(
STranslateContext
*
pCxt
,
SFunctionNode
*
pFunc
,
SValueNode
**
pVal
)
{
int32_t
code
=
getFuncInfo
(
pCxt
,
pFunc
);
static
SDataType
schemaToDataType
(
uint8_t
precision
,
SSchema
*
pSchema
)
{
SDataType
dt
=
{.
type
=
pSchema
->
type
,
.
bytes
=
pSchema
->
bytes
,
.
precision
=
precision
,
.
scale
=
0
};
return
dt
;
}
static
int32_t
createCastFuncForTag
(
STranslateContext
*
pCxt
,
SNode
*
pNode
,
SDataType
dt
,
SNode
**
pCast
)
{
SNode
*
pExpr
=
nodesCloneNode
(
pNode
);
if
(
NULL
==
pExpr
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
int32_t
code
=
translateExpr
(
pCxt
,
&
pExpr
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
scalarCalculateConstants
((
SNode
*
)
pFunc
,
(
SNode
**
)
pVal
);
code
=
createCastFunc
(
pCxt
,
pExpr
,
dt
,
pCast
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
nodesDestroyNode
(
pExpr
);
}
return
code
;
}
static
SDataType
schemaToDataType
(
uint8_t
precision
,
SSchema
*
pSchema
)
{
SDataType
dt
=
{.
type
=
pSchema
->
type
,
.
bytes
=
pSchema
->
bytes
,
.
precision
=
precision
,
.
scale
=
0
};
return
dt
;
static
int32_t
createTagValFromExpr
(
STranslateContext
*
pCxt
,
SDataType
targetDt
,
SNode
*
pNode
,
SValueNode
**
pVal
)
{
SNode
*
pCast
=
NULL
;
int32_t
code
=
createCastFuncForTag
(
pCxt
,
pNode
,
targetDt
,
&
pCast
);
SNode
*
pNew
=
NULL
;
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
scalarCalculateConstants
(
pCast
,
&
pNew
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
pCast
=
pNew
;
if
(
QUERY_NODE_VALUE
!=
nodeType
(
pCast
))
{
code
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_WRONG_VALUE_TYPE
,
((
SExprNode
*
)
pNode
)
->
aliasName
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
*
pVal
=
(
SValueNode
*
)
pCast
;
}
else
{
nodesDestroyNode
(
pCast
);
}
return
code
;
}
static
int32_t
createTagValFromVal
(
STranslateContext
*
pCxt
,
SDataType
targetDt
,
SNode
*
pNode
,
SValueNode
**
pVal
)
{
*
pVal
=
(
SValueNode
*
)
nodesCloneNode
(
pNode
);
if
(
NULL
==
*
pVal
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
return
DEAL_RES_ERROR
==
translateValueImpl
(
pCxt
,
*
pVal
,
targetDt
)
?
pCxt
->
errCode
:
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateTagVal
(
STranslateContext
*
pCxt
,
uint8_t
precision
,
SSchema
*
pSchema
,
SNode
*
pNode
,
SValueNode
**
pVal
)
{
if
(
QUERY_NODE_FUNCTION
==
nodeType
(
pNode
))
{
return
createValueFromFunction
(
pCxt
,
(
SFunctionNode
*
)
pNode
,
pVal
);
}
else
if
(
QUERY_NODE_VALUE
==
nodeType
(
pNode
))
{
return
(
DEAL_RES_ERROR
==
translateValueImpl
(
pCxt
,
(
SValueNode
*
)
pNode
,
schemaToDataType
(
precision
,
pSchema
))
?
pCxt
->
errCode
:
TSDB_CODE_SUCCESS
);
static
int32_t
createTagVal
(
STranslateContext
*
pCxt
,
uint8_t
precision
,
SSchema
*
pSchema
,
SNode
*
pNode
,
SValueNode
**
pVal
)
{
if
(
QUERY_NODE_VALUE
==
nodeType
(
pNode
))
{
return
createTagValFromVal
(
pCxt
,
schemaToDataType
(
precision
,
pSchema
),
pNode
,
pVal
);
}
else
{
// return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)pNode)->aliasName);
return
TSDB_CODE_FAILED
;
return
createTagValFromExpr
(
pCxt
,
schemaToDataType
(
precision
,
pSchema
),
pNode
,
pVal
);
}
}
...
...
@@ -5285,56 +5384,45 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla
if
(
NULL
==
pTagArray
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
SSchema
*
pTagSchema
=
getTableTagSchema
(
pSuperTableMeta
);
SNode
*
pTag
=
NULL
,
*
pNode
=
NULL
;
bool
isJson
=
false
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
bool
isJson
=
false
;
SNodeList
*
pVals
=
NULL
;
SNode
*
pTag
=
NULL
,
*
pNode
=
NULL
;
FORBOTH
(
pTag
,
pStmt
->
pSpecificTags
,
pNode
,
pStmt
->
pValsOfTags
)
{
SColumnNode
*
pCol
=
(
SColumnNode
*
)
pTag
;
SSchema
*
pSchema
=
NULL
;
for
(
int32_t
i
=
0
;
i
<
numOfTags
;
++
i
)
{
if
(
0
==
strcmp
(
pCol
->
colName
,
pTagSchema
[
i
].
name
))
{
pSchema
=
pTagSchema
+
i
;
break
;
}
}
SSchema
*
pSchema
=
getTagSchema
(
pSuperTableMeta
,
pCol
->
colName
);
if
(
NULL
==
pSchema
)
{
code
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_TAG_NAME
,
pCol
->
colName
);
goto
end
;
}
SValueNode
*
pVal
=
NULL
;
code
=
translateTagVal
(
pCxt
,
pSuperTableMeta
->
tableInfo
.
precision
,
pSchema
,
pNode
,
&
pVal
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
goto
end
;
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
createTagVal
(
pCxt
,
pSuperTableMeta
->
tableInfo
.
precision
,
pSchema
,
pNode
,
&
pVal
);
}
if
(
NULL
==
pVal
)
{
pVal
=
(
SValueNode
*
)
pNode
;
}
else
{
REPLACE_LIST2_NODE
(
pVal
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_JSON
)
{
isJson
=
true
;
code
=
buildJsonTagVal
(
pCxt
,
pSchema
,
pVal
,
pTagArray
,
ppTag
);
}
else
if
(
pVal
->
node
.
resType
.
type
!=
TSDB_DATA_TYPE_NULL
)
{
code
=
buildNormalTagVal
(
pCxt
,
pSchema
,
pVal
,
pTagArray
);
}
}
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_JSON
)
{
isJson
=
true
;
code
=
buildJsonTagVal
(
pCxt
,
pSchema
,
pVal
,
pTagArray
,
ppTag
);
}
else
if
(
pVal
->
node
.
resType
.
type
!=
TSDB_DATA_TYPE_NULL
)
{
code
=
buildNormalTagVal
(
pCxt
,
pSchema
,
pVal
,
pTagArray
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodesListMakeAppend
(
&
pVals
,
(
SNode
*
)
pVal
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
break
;
}
}
if
(
!
isJson
)
code
=
tTagNew
(
pTagArray
,
1
,
false
,
ppTag
);
end:
if
(
isJson
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
pTagArray
);
++
i
)
{
STagVal
*
p
=
(
STagVal
*
)
taosArrayGet
(
pTagArray
,
i
);
if
(
IS_VAR_DATA_TYPE
(
p
->
type
))
{
taosMemoryFree
(
p
->
pData
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
isJson
)
{
code
=
tTagNew
(
pTagArray
,
1
,
false
,
ppTag
);
}
nodesDestroyList
(
pVals
);
taosArrayDestroy
(
pTagArray
);
return
TSDB_CODE_SUCCESS
;
return
code
;
}
static
int32_t
buildKVRowForAllTags
(
STranslateContext
*
pCxt
,
SCreateSubTableClause
*
pStmt
,
STableMeta
*
pSuperTableMeta
,
...
...
@@ -5343,64 +5431,52 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_TAGS_NOT_MATCHED
);
}
SSchema
*
pTagSchemas
=
getTableTagSchema
(
pSuperTableMeta
);
SNode
*
pNode
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
index
=
0
;
SArray
*
pTagArray
=
taosArrayInit
(
LIST_LENGTH
(
pStmt
->
pValsOfTags
),
sizeof
(
STagVal
));
if
(
!
pTagArray
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_TSC_OUT_OF_MEMORY
);
SArray
*
pTagArray
=
taosArrayInit
(
LIST_LENGTH
(
pStmt
->
pValsOfTags
),
sizeof
(
STagVal
));
if
(
NULL
==
pTagArray
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
bool
isJson
=
false
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
bool
isJson
=
false
;
int32_t
index
=
0
;
SSchema
*
pTagSchemas
=
getTableTagSchema
(
pSuperTableMeta
);
SNodeList
*
pVals
=
NULL
;
SNode
*
pNode
;
FOREACH
(
pNode
,
pStmt
->
pValsOfTags
)
{
SValueNode
*
pVal
=
NULL
;
SSchema
*
pTagSchema
=
pTagSchemas
+
index
;
code
=
translateTagVal
(
pCxt
,
pSuperTableMeta
->
tableInfo
.
precision
,
pTagSchema
,
pNode
,
&
pVal
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
goto
end
;
code
=
createTagVal
(
pCxt
,
pSuperTableMeta
->
tableInfo
.
precision
,
pTagSchema
,
pNode
,
&
pVal
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
pTagSchema
->
type
==
TSDB_DATA_TYPE_JSON
)
{
isJson
=
true
;
code
=
buildJsonTagVal
(
pCxt
,
pTagSchema
,
pVal
,
pTagArray
,
ppTag
);
}
else
if
(
pVal
->
node
.
resType
.
type
!=
TSDB_DATA_TYPE_NULL
&&
!
pVal
->
isNull
)
{
char
*
tmpVal
=
nodesGetValueFromNode
(
pVal
);
STagVal
val
=
{.
cid
=
pTagSchema
->
colId
,
.
type
=
pTagSchema
->
type
};
if
(
IS_VAR_DATA_TYPE
(
pTagSchema
->
type
))
{
val
.
pData
=
varDataVal
(
tmpVal
);
val
.
nData
=
varDataLen
(
tmpVal
);
}
else
{
memcpy
(
&
val
.
i64
,
tmpVal
,
pTagSchema
->
bytes
);
}
taosArrayPush
(
pTagArray
,
&
val
);
}
}
if
(
NULL
==
pVal
)
{
pVal
=
(
SValueNode
*
)
pNode
;
}
else
{
REPLACE_NODE
(
pVal
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodesListMakeAppend
(
&
pVals
,
(
SNode
*
)
pVal
);
}
if
(
pTagSchema
->
type
==
TSDB_DATA_TYPE_JSON
)
{
if
(
pVal
->
literal
&&
strlen
(
pVal
->
literal
)
>
(
TSDB_MAX_JSON_TAG_LEN
-
VARSTR_HEADER_SIZE
)
/
TSDB_NCHAR_SIZE
)
{
code
=
buildSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
"json string too long than 4095"
,
pVal
->
literal
);
goto
end
;
}
isJson
=
true
;
code
=
parseJsontoTagData
(
pVal
->
literal
,
pTagArray
,
ppTag
,
&
pCxt
->
msgBuf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
end
;
}
}
else
if
(
pVal
->
node
.
resType
.
type
!=
TSDB_DATA_TYPE_NULL
&&
!
pVal
->
isNull
)
{
char
*
tmpVal
=
nodesGetValueFromNode
(
pVal
);
STagVal
val
=
{.
cid
=
pTagSchema
->
colId
,
.
type
=
pTagSchema
->
type
};
if
(
IS_VAR_DATA_TYPE
(
pTagSchema
->
type
))
{
val
.
pData
=
varDataVal
(
tmpVal
);
val
.
nData
=
varDataLen
(
tmpVal
);
}
else
{
memcpy
(
&
val
.
i64
,
tmpVal
,
pTagSchema
->
bytes
);
}
taosArrayPush
(
pTagArray
,
&
val
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
break
;
}
++
index
;
}
if
(
!
isJson
)
code
=
tTagNew
(
pTagArray
,
1
,
false
,
ppTag
);
end:
if
(
isJson
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
pTagArray
);
++
i
)
{
STagVal
*
p
=
(
STagVal
*
)
taosArrayGet
(
pTagArray
,
i
);
if
(
IS_VAR_DATA_TYPE
(
p
->
type
))
{
taosMemoryFree
(
p
->
pData
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
isJson
)
{
code
=
tTagNew
(
pTagArray
,
1
,
false
,
ppTag
);
}
nodesDestroyList
(
pVals
);
taosArrayDestroy
(
pTagArray
);
return
code
;
}
...
...
@@ -5898,15 +5974,6 @@ static int32_t rewriteAlterTableImpl(STranslateContext* pCxt, SAlterTableStmt* p
}
if
(
TSDB_SUPER_TABLE
==
pTableMeta
->
tableType
)
{
SSchema
*
pTagsSchema
=
getTableTagSchema
(
pTableMeta
);
if
(
getNumOfTags
(
pTableMeta
)
==
1
&&
pTagsSchema
->
type
==
TSDB_DATA_TYPE_JSON
&&
(
pStmt
->
alterType
==
TSDB_ALTER_TABLE_ADD_TAG
||
pStmt
->
alterType
==
TSDB_ALTER_TABLE_DROP_TAG
||
pStmt
->
alterType
==
TSDB_ALTER_TABLE_UPDATE_TAG_BYTES
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_ONE_JSON_TAG
);
}
if
(
pStmt
->
alterType
==
TSDB_ALTER_TABLE_UPDATE_OPTIONS
&&
-
1
!=
pStmt
->
pOptions
->
ttl
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
);
}
return
TSDB_CODE_SUCCESS
;
}
else
if
(
TSDB_CHILD_TABLE
!=
pTableMeta
->
tableType
&&
TSDB_NORMAL_TABLE
!=
pTableMeta
->
tableType
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
);
...
...
@@ -5929,10 +5996,6 @@ static int32_t rewriteAlterTableImpl(STranslateContext* pCxt, SAlterTableStmt* p
static
int32_t
rewriteAlterTable
(
STranslateContext
*
pCxt
,
SQuery
*
pQuery
)
{
SAlterTableStmt
*
pStmt
=
(
SAlterTableStmt
*
)
pQuery
->
pRoot
;
if
(
pStmt
->
dataType
.
type
==
TSDB_DATA_TYPE_JSON
&&
pStmt
->
alterType
==
TSDB_ALTER_TABLE_ADD_TAG
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_ONE_JSON_TAG
);
}
if
(
pStmt
->
dataType
.
type
==
TSDB_DATA_TYPE_JSON
&&
pStmt
->
alterType
==
TSDB_ALTER_TABLE_ADD_COLUMN
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_COL_JSON
);
}
...
...
source/libs/parser/src/parUtil.c
浏览文件 @
ba72ce2b
...
...
@@ -215,13 +215,21 @@ int32_t generateSyntaxErrMsg(SMsgBuf* pBuf, int32_t errCode, ...) {
return
errCode
;
}
int32_t
generateSyntaxErrMsgExt
(
SMsgBuf
*
pBuf
,
int32_t
errCode
,
const
char
*
pFormat
,
...)
{
va_list
vArgList
;
va_start
(
vArgList
,
pFormat
);
vsnprintf
(
pBuf
->
buf
,
pBuf
->
len
,
pFormat
,
vArgList
);
va_end
(
vArgList
);
return
errCode
;
}
int32_t
buildInvalidOperationMsg
(
SMsgBuf
*
pBuf
,
const
char
*
msg
)
{
strncpy
(
pBuf
->
buf
,
msg
,
pBuf
->
len
);
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
int32_t
buildSyntaxErrMsg
(
SMsgBuf
*
pBuf
,
const
char
*
additionalInfo
,
const
char
*
sourceStr
)
{
if
(
pBuf
==
NULL
)
return
TSDB_CODE_TSC_SQL_SYNTAX_ERROR
;
if
(
pBuf
==
NULL
)
return
TSDB_CODE_TSC_SQL_SYNTAX_ERROR
;
const
char
*
msgFormat1
=
"syntax error near
\'
%s
\'
"
;
const
char
*
msgFormat2
=
"syntax error near
\'
%s
\'
(%s)"
;
const
char
*
msgFormat3
=
"%s"
;
...
...
source/libs/parser/src/sql.c
浏览文件 @
ba72ce2b
...
...
@@ -216,609 +216,635 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (2
471
)
#define YY_ACTTAB_COUNT (2
609
)
static
const
YYACTIONTYPE
yy_action
[]
=
{
/* 0 */
422
,
1
670
,
423
,
1475
,
294
,
1744
,
1438
,
430
,
317
,
423
,
/* 10 */
1475
,
1563
,
39
,
37
,
1505
,
338
,
1741
,
69
,
1619
,
162
1
,
/* 20 */
3
26
,
1441
,
1238
,
1744
,
1900
,
1565
,
334
,
525
,
373
,
379
,
/* 30 */
115
,
1674
,
1775
,
1313
,
1741
,
1236
,
1741
,
1899
,
1552
,
1569
,
/* 40 */
518
,
1897
,
101
,
1737
,
1743
,
100
,
99
,
98
,
97
,
96
,
/* 50 */
95
,
94
,
93
,
92
,
570
,
119
,
1308
,
987
,
1757
,
14
,
/* 60 */
61
,
1737
,
1743
,
1737
,
1743
,
1244
,
297
,
343
,
1900
,
39
,
/* 70 */
3
7
,
1376
,
570
,
439
,
570
,
474
,
473
,
326
,
517
,
1238
,
/* 80 */
472
,
157
,
1
,
116
,
469
,
1897
,
1775
,
468
,
467
,
466
,
/* 90 */
1313
,
1004
,
1236
,
1003
,
528
,
117
,
439
,
991
,
992
,
1727
,
/* 100 */
479
,
548
,
1380
,
310
,
649
,
566
,
458
,
1900
,
1262
,
527
,
/* 110 */
153
,
1842
,
1843
,
1308
,
1847
,
489
,
14
,
552
,
1315
,
1316
,
/* 120 */
157
,
1005
,
1244
,
1550
,
1897
,
329
,
412
,
1788
,
1671
,
202
,
/* 130 */
88
,
1758
,
551
,
1760
,
1761
,
547
,
60
,
570
,
6
0
,
2
,
/* 140 */
1834
,
525
,
210
,
482
,
319
,
1830
,
152
,
476
,
30
,
240
,
/* 150 */
652
,
311
,
201
,
309
,
308
,
140
,
462
,
1452
,
156
,
421
,
/* 160 */
464
,
649
,
425
,
1239
,
262
,
1237
,
1860
,
43
,
60
,
119
,
/* 170 */
73
,
330
,
171
,
170
,
566
,
1315
,
1316
,
55
,
149
,
138
,
/* 180 */
54
,
604
,
463
,
642
,
638
,
634
,
630
,
260
,
1576
,
1242
,
/* 190 */
1243
,
519
,
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
54
4
,
/* 200 */
56
8
,
1306
,
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
117
,
/* 210 */
1263
,
1669
,
85
,
1323
,
294
,
254
,
372
,
167
,
371
,
1262
,
/* 220 */
1239
,
160
,
1237
,
4
27
,
154
,
1842
,
1843
,
1900
,
1847
,
1260
,
/* 230 */
1
745
,
33
,
32
,
504
,
1263
,
40
,
38
,
36
,
35
,
34
,
/* 240 */
158
,
1741
,
67
,
525
,
1897
,
66
,
1242
,
1243
,
563
,
1291
,
/* 250 */
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
5
44
,
568
,
1306
,
1307
,
/* 260 */
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
39
,
37
,
1737
,
1743
,
/* 270 */
488
,
119
,
490
,
1900
,
326
,
160
,
1238
,
160
,
69
,
570
,
/* 280 */
212
,
1293
,
300
,
486
,
60
,
484
,
157
,
1313
,
101
,
1236
,
/* 290 */
1897
,
100
,
99
,
98
,
97
,
96
,
95
,
94
,
93
,
92
,
/* 300 */
1570
,
1211
,
151
,
205
,
1900
,
552
,
1276
,
160
,
1136
,
113
7
,
/* 310 */
1308
,
11
7
,
1900
,
14
,
1335
,
1613
,
1672
,
1898
,
1262
,
1244
,
/* 320 */
602
,
1897
,
566
,
39
,
37
,
157
,
155
,
1842
,
1843
,
1897
,
/* 330 */
1847
,
3
26
,
604
,
1238
,
1502
,
1004
,
2
,
1003
,
1261
,
129
,
/* 340 */
128
,
599
,
598
,
597
,
1313
,
78
,
1236
,
1094
,
593
,
592
,
/* 0 */
422
,
1
563
,
423
,
1475
,
1900
,
430
,
1438
,
423
,
1475
,
69
,
/* 10 */
69
,
379
,
40
,
38
,
1744
,
141
,
1775
,
1899
,
541
,
153
1
,
/* 20 */
3
33
,
1897
,
1238
,
115
,
534
,
1741
,
41
,
39
,
37
,
36
,
/* 30 */
35
,
1570
,
1569
,
1313
,
101
,
1236
,
1565
,
100
,
99
,
98
,
/* 40 */
97
,
96
,
95
,
94
,
93
,
92
,
120
,
1741
,
297
,
544
,
/* 50 */
1745
,
1737
,
1743
,
322
,
338
,
1757
,
1308
,
1619
,
1621
,
14
,
/* 60 */
544
,
1741
,
533
,
562
,
439
,
1244
,
343
,
546
,
1263
,
40
,
/* 70 */
3
8
,
1376
,
541
,
1737
,
1743
,
1552
,
1900
,
333
,
140
,
1238
,
/* 80 */
1452
,
167
,
1
,
1775
,
544
,
562
,
118
,
1737
,
1743
,
158
,
/* 90 */
1313
,
569
,
1236
,
1897
,
373
,
464
,
1727
,
1900
,
568
,
562
,
/* 100 */
120
,
245
,
1842
,
540
,
649
,
539
,
67
,
1900
,
1900
,
66
,
/* 110 */
1898
,
44
,
546
,
1308
,
1897
,
1056
,
14
,
463
,
1315
,
1316
,
/* 120 */
157
,
159
,
1244
,
1788
,
1897
,
1897
,
1263
,
87
,
1758
,
571
,
/* 130 */
1760
,
1761
,
567
,
439
,
562
,
1900
,
60
,
1834
,
138
0
,
2
,
/* 140 */
118
,
300
,
1830
,
541
,
1262
,
1058
,
43
,
1262
,
157
,
151
,
/* 150 */
652
,
210
,
1897
,
1900
,
543
,
153
,
1842
,
1843
,
1004
,
1847
,
/* 160 */
1003
,
649
,
1613
,
1239
,
262
,
1237
,
159
,
31
,
255
,
987
,
/* 170 */
1897
,
120
,
535
,
458
,
320
,
1315
,
1316
,
60
,
149
,
73
,
/* 180 */
604
,
203
,
138
,
642
,
638
,
634
,
630
,
260
,
1005
,
1242
,
/* 190 */
1243
,
1576
,
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
56
4
,
/* 200 */
56
0
,
1306
,
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
991
,
/* 210 */
992
,
118
,
85
,
1323
,
421
,
225
,
372
,
425
,
371
,
1262
,
/* 220 */
1239
,
160
,
1237
,
4
12
,
1136
,
1137
,
154
,
1842
,
1843
,
1261
,
/* 230 */
1
847
,
34
,
33
,
310
,
505
,
41
,
39
,
37
,
36
,
35
,
/* 240 */
71
,
299
,
319
,
541
,
507
,
1671
,
1242
,
1243
,
514
,
1291
,
/* 250 */
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
5
64
,
560
,
1306
,
1307
,
/* 260 */
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
40
,
38
,
1440
,
171
,
/* 270 */
170
,
120
,
1626
,
1674
,
333
,
160
,
1238
,
216
,
217
,
321
,
/* 280 */
212
,
311
,
301
,
309
,
308
,
160
,
462
,
1313
,
1624
,
1236
,
/* 290 */
464
,
530
,
110
,
109
,
108
,
107
,
106
,
105
,
104
,
103
,
/* 300 */
102
,
1211
,
1463
,
205
,
517
,
429
,
1276
,
517
,
425
,
51
7
,
/* 310 */
1308
,
11
8
,
463
,
14
,
1335
,
111
,
160
,
1293
,
111
,
1244
,
/* 320 */
162
,
61
,
460
,
40
,
38
,
465
,
155
,
1842
,
1843
,
60
,
/* 330 */
1847
,
3
33
,
1574
,
1238
,
1502
,
1574
,
2
,
1574
,
299
,
427
,
/* 340 */
1462
,
507
,
1244
,
1727
,
1313
,
1260
,
1236
,
1094
,
593
,
592
,
/* 350 */
591
,
1098
,
590
,
1100
,
1101
,
589
,
1103
,
586
,
649
,
1109
,
/* 360 */
583
,
1111
,
1112
,
580
,
577
,
1
005
,
1567
,
1308
,
1336
,
36
,
/* 370 */
35
,
34
,
1315
,
1316
,
1664
,
1463
,
1244
,
40
,
38
,
36
,
/* 380 */
35
,
34
,
33
,
32
,
42
,
169
,
40
,
38
,
36
,
35
,
/* 390 */
3
4
,
1341
,
1293
,
8
,
541
,
626
,
625
,
624
,
341
,
596
,
/* 360 */
583
,
1111
,
1112
,
580
,
577
,
1
550
,
517
,
1308
,
1336
,
5
36
,
/* 370 */
531
,
600
,
1315
,
1316
,
1617
,
1461
,
1244
,
377
,
37
,
36
,
/* 380 */
35
,
1727
,
34
,
33
,
1620
,
1621
,
41
,
39
,
37
,
36
,
/* 390 */
3
5
,
1341
,
1293
,
8
,
1574
,
626
,
625
,
624
,
341
,
60
,
/* 400 */
623
,
622
,
621
,
121
,
616
,
615
,
614
,
613
,
612
,
611
,
/* 410 */
610
,
609
,
131
,
605
,
141
,
649
,
1727
,
1239
,
1531
,
1237
,
/* 420 */
3
3
,
32
,
1397
,
160
,
40
,
38
,
36
,
35
,
34
,
1315
,
/* 430 */
1316
,
1551
,
29
,
324
,
1330
,
1331
,
1332
,
1333
,
1334
,
1338
,
/* 440 */
1339
,
1340
,
600
,
1242
,
1243
,
161
7
,
1291
,
1292
,
1294
,
1295
,
/* 450 */
1296
,
1297
,
1298
,
5
44
,
568
,
1306
,
1307
,
1309
,
1310
,
1311
,
/* 460 */
1312
,
1314
,
1317
,
5
11
,
1395
,
1396
,
1398
,
1399
,
1056
,
56
7
,
/* 470 */
474
,
473
,
138
,
1337
,
1239
,
472
,
1237
,
1264
,
116
,
469
,
/* 480 */
111
,
1577
,
468
,
467
,
466
,
33
,
32
,
460
,
1244
,
40
,
/* 490 */
3
8
,
36
,
35
,
34
,
607
,
1407
,
1342
,
1574
,
1058
,
1462
,
/* 500 */
1242
,
1243
,
203
,
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
/* 510 */
5
44
,
568
,
1306
,
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
/* 520 */
39
,
37
,
1318
,
160
,
1327
,
602
,
1620
,
1621
,
326
,
1433
,
/* 530 */
1238
,
567
,
160
,
471
,
470
,
189
,
300
,
27
,
245
,
246
,
/* 540 */
1
727
,
1313
,
162
,
1236
,
129
,
128
,
599
,
598
,
597
,
144
,
/* 550 */
1559
,
525
,
567
,
1626
,
456
,
452
,
448
,
444
,
188
,
1574
,
/* 560 */
331
,
71
,
305
,
111
,
1308
,
556
,
1265
,
336
,
1335
,
1624
,
/* 570 */
4
65
,
11
,
10
,
1244
,
339
,
138
,
497
,
39
,
37
,
119
,
/* 580 */
1
574
,
1561
,
138
,
70
,
1576
,
326
,
186
,
1238
,
33
,
32
,
/* 590 */
9
,
157
6
,
40
,
38
,
36
,
35
,
34
,
84
,
1313
,
305
,
/* 600 */
1236
,
529
,
556
,
1757
,
567
,
567
,
464
,
232
,
1626
,
1461
,
/* 610 */
120
,
1460
,
649
,
1626
,
567
,
377
,
378
,
1432
,
1566
,
117
,
/* 620 */
3
37
,
1308
,
1336
,
22
,
1625
,
382
,
1315
,
1316
,
463
,
1624
,
/* 630 */
1244
,
1775
,
1574
,
1574
,
230
,
1842
,
524
,
1262
,
523
,
549
,
/* 640 */
1459
,
1900
,
1574
,
364
,
1727
,
1341
,
548
,
9
,
185
,
178
,
/* 650 */
1727
,
183
,
1727
,
1349
,
159
,
435
,
33
,
32
,
1897
,
51
4
,
/* 660 */
4
0
,
38
,
36
,
35
,
34
,
366
,
362
,
429
,
58
,
649
,
/* 670 */
425
,
1239
,
1788
,
1237
,
176
,
142
,
1758
,
551
,
1760
,
1761
,
/* 680 */
547
,
1727
,
570
,
1315
,
1316
,
1549
,
29
,
324
,
1330
,
1331
,
/* 690 */
1332
,
1333
,
1334
,
1338
,
1339
,
1340
,
213
,
1242
,
1243
,
1458
,
/* 700 */
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
5
44
,
568
,
1306
,
/* 710 */
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
144
0
,
267
,
530
,
/* 720 */
1914
,
1604
,
567
,
567
,
567
,
620
,
618
,
1557
,
1239
,
601
,
/* 730 */
1237
,
1387
,
1617
,
397
,
398
,
438
,
206
,
520
,
515
,
1715
,
/* 740 */
1
727
,
110
,
109
,
108
,
107
,
106
,
105
,
104
,
103
,
10
2
,
/* 750 */
1574
,
1574
,
1574
,
525
,
1242
,
1243
,
543
,
1291
,
1292
,
1294
,
/* 760 */
1295
,
1296
,
1297
,
1298
,
5
44
,
568
,
1306
,
1307
,
1309
,
1310
,
/* 770 */
1311
,
1312
,
1314
,
1317
,
39
,
37
,
296
,
1238
,
1260
,
602
,
/* 780 */
5
67
,
119
,
326
,
567
,
1238
,
405
,
352
,
1457
,
417
,
1849
,
/* 790 */
1
236
,
1571
,
1849
,
595
,
1703
,
1313
,
1373
,
1236
,
129
,
128
,
/* 800 */
599
,
598
,
597
,
529
,
1456
,
390
,
567
,
418
,
1574
,
392
,
/* 810 */
1
293
,
1574
,
244
,
1846
,
991
,
992
,
1845
,
498
,
1308
,
1453
,
/* 820 */
1244
,
117
,
567
,
7
,
1455
,
1849
,
1532
,
1244
,
1727
,
1854
,
/* 830 */
1369
,
1454
,
194
,
502
,
1574
,
192
,
230
,
1842
,
524
,
383
,
/* 840 */
5
23
,
26
,
235
,
1900
,
2
,
1727
,
533
,
33
,
32
,
1844
,
/* 850 */
1574
,
40
,
38
,
36
,
35
,
34
,
157
,
28
,
512
,
649
,
/* 860 */
1897
,
44
,
4
,
33
,
32
,
1727
,
649
,
40
,
38
,
36
,
/* 870 */
3
5
,
34
,
1727
,
457
,
1219
,
1220
,
1451
,
52
,
50
1
,
416
,
/* 410 */
610
,
609
,
131
,
605
,
596
,
649
,
1727
,
1239
,
1849
,
1237
,
/* 420 */
3
4
,
33
,
1397
,
604
,
41
,
39
,
37
,
36
,
35
,
1315
,
/* 430 */
1316
,
1551
,
30
,
331
,
1330
,
1331
,
1332
,
1333
,
1334
,
1338
,
/* 440 */
1339
,
1340
,
1846
,
1242
,
1243
,
60
7
,
1291
,
1292
,
1294
,
1295
,
/* 450 */
1296
,
1297
,
1298
,
5
64
,
560
,
1306
,
1307
,
1309
,
1310
,
1311
,
/* 460 */
1312
,
1314
,
1317
,
5
27
,
1395
,
1396
,
1398
,
1399
,
160
,
51
7
,
/* 470 */
474
,
473
,
471
,
470
,
1239
,
472
,
1237
,
1559
,
116
,
469
,
/* 480 */
378
,
84
,
468
,
467
,
466
,
34
,
33
,
11
,
10
,
41
,
/* 490 */
3
9
,
37
,
36
,
35
,
117
,
1407
,
1004
,
1574
,
1003
,
209
,
/* 500 */
1242
,
1243
,
1566
,
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
/* 510 */
5
64
,
560
,
1306
,
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
/* 520 */
40
,
38
,
1318
,
336
,
479
,
602
,
1005
,
72
,
333
,
1433
,
/* 530 */
1238
,
138
,
160
,
1505
,
504
,
189
,
301
,
1561
,
160
,
489
,
/* 540 */
1
576
,
1313
,
339
,
1236
,
129
,
128
,
599
,
598
,
597
,
144
,
/* 550 */
138
,
517
,
497
,
202
,
456
,
452
,
448
,
444
,
188
,
1576
,
/* 560 */
77
,
517
,
382
,
517
,
1308
,
620
,
618
,
482
,
1335
,
1349
,
/* 570 */
4
90
,
476
,
397
,
1244
,
398
,
1900
,
201
,
40
,
38
,
1574
,
/* 580 */
1
626
,
1567
,
517
,
70
,
58
,
333
,
186
,
1238
,
157
,
1574
,
/* 590 */
9
,
157
4
,
1897
,
438
,
474
,
473
,
1625
,
364
,
1313
,
472
,
/* 600 */
1236
,
55
,
116
,
469
,
54
,
517
,
468
,
467
,
466
,
7
,
/* 610 */
1574
,
1900
,
649
,
1670
,
517
,
294
,
1571
,
1432
,
517
,
366
,
/* 620 */
3
62
,
1308
,
1336
,
1373
,
157
,
1703
,
1315
,
1316
,
1897
,
498
,
/* 630 */
1244
,
34
,
33
,
1574
,
1460
,
41
,
39
,
37
,
36
,
35
,
/* 640 */
991
,
992
,
1574
,
1626
,
1459
,
1341
,
1574
,
9
,
185
,
178
,
/* 650 */
337
,
183
,
1849
,
1264
,
517
,
435
,
34
,
33
,
1458
,
162
4
,
/* 660 */
4
1
,
39
,
37
,
36
,
35
,
502
,
23
,
1664
,
517
,
649
,
/* 670 */
1669
,
1239
,
294
,
1237
,
176
,
1727
,
1845
,
215
,
169
,
515
,
/* 680 */
1457
,
550
,
1574
,
1315
,
1316
,
1727
,
30
,
331
,
1330
,
1331
,
/* 690 */
1332
,
1333
,
1334
,
1338
,
1339
,
1340
,
1574
,
1242
,
1243
,
1727
,
/* 700 */
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
1298
,
5
64
,
560
,
1306
,
/* 710 */
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
1317
,
144
1
,
34
,
33
,
/* 720 */
488
,
1727
,
41
,
39
,
37
,
36
,
35
,
1849
,
1239
,
601
,
/* 730 */
1237
,
1387
,
1617
,
486
,
267
,
484
,
1456
,
1604
,
101
,
1219
,
/* 740 */
1
220
,
100
,
99
,
98
,
97
,
96
,
95
,
94
,
93
,
9
2
,
/* 750 */
608
,
1844
,
1546
,
541
,
1242
,
1243
,
1715
,
1291
,
1292
,
1294
,
/* 760 */
1295
,
1296
,
1297
,
1298
,
5
64
,
560
,
1306
,
1307
,
1309
,
1310
,
/* 770 */
1311
,
1312
,
1314
,
1317
,
40
,
38
,
296
,
1727
,
1260
,
553
,
/* 780 */
5
17
,
120
,
333
,
247
,
1238
,
405
,
1453
,
1455
,
417
,
517
,
/* 790 */
1
369
,
516
,
602
,
1276
,
1454
,
1313
,
1265
,
1236
,
1557
,
505
,
/* 800 */
256
,
1337
,
546
,
352
,
1451
,
390
,
1262
,
418
,
1574
,
392
,
/* 810 */
1
672
,
129
,
128
,
599
,
598
,
597
,
1247
,
1574
,
1308
,
548
,
/* 820 */
517
,
118
,
1854
,
1369
,
1342
,
45
,
4
,
1244
,
1727
,
52
,
/* 830 */
501
,
340
,
1450
,
138
,
1449
,
1727
,
245
,
1842
,
540
,
383
,
/* 840 */
5
39
,
1372
,
1577
,
1900
,
2
,
1727
,
34
,
33
,
1574
,
528
,
/* 850 */
41
,
39
,
37
,
36
,
35
,
194
,
157
,
206
,
192
,
1448
,
/* 860 */
1897
,
1238
,
1447
,
34
,
33
,
28
,
649
,
41
,
39
,
37
,
/* 870 */
3
6
,
35
,
1446
,
1727
,
1236
,
1727
,
563
,
1246
,
55
1
,
416
,
/* 880 */
1315
,
1316
,
411
,
410
,
409
,
408
,
407
,
404
,
403
,
402
,
/* 890 */
401
,
400
,
396
,
395
,
394
,
393
,
387
,
386
,
385
,
384
,
/* 900 */
1492
,
381
,
380
,
531
,
196
,
567
,
1450
,
195
,
567
,
139
,
/* 910 */
536
,
608
,
1449
,
1546
,
273
,
491
,
564
,
1727
,
1239
,
565
,
/* 920 */
1237
,
198
,
475
,
200
,
197
,
1239
,
199
,
1237
,
271
,
57
,
/* 930 */
11
,
10
,
56
,
1574
,
33
,
32
,
1574
,
1448
,
40
,
38
,
/* 940 */
36
,
35
,
34
,
1757
,
1242
,
1243
,
1447
,
1727
,
172
,
1446
,
/* 950 */
1445
,
1242
,
1243
,
1727
,
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
/* 960 */
1298
,
544
,
568
,
1306
,
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
/* 970 */
1317
,
1775
,
567
,
60
,
567
,
1435
,
1436
,
209
,
1727
,
549
,
/* 980 */
1444
,
1487
,
224
,
256
,
1727
,
340
,
548
,
1727
,
33
,
32
,
/* 990 */
1727
,
1727
,
40
,
38
,
36
,
35
,
34
,
1443
,
1776
,
619
,
/* 1000 */
1574
,
529
,
1574
,
477
,
1369
,
72
,
1747
,
1247
,
1246
,
1276
,
/* 1010 */
50
,
86
,
1788
,
217
,
1372
,
87
,
1758
,
551
,
1760
,
1761
,
/* 1020 */
547
,
1727
,
570
,
1485
,
1757
,
1834
,
1476
,
33
,
32
,
299
,
/* 1030 */
1830
,
40
,
38
,
36
,
35
,
34
,
1481
,
342
,
1727
,
367
,
/* 1040 */
1614
,
1900
,
1749
,
534
,
1757
,
480
,
64
,
63
,
376
,
41
,
/* 1050 */
1394
,
166
,
1775
,
219
,
159
,
41
,
83
,
370
,
1897
,
1864
,
/* 1060 */
549
,
1028
,
229
,
526
,
41
,
1727
,
80
,
548
,
242
,
234
,
/* 1070 */
295
,
237
,
1775
,
360
,
123
,
358
,
354
,
350
,
163
,
345
,
/* 1080 */
528
,
239
,
529
,
3
,
644
,
1727
,
5
,
548
,
126
,
1343
,
/* 1090 */
344
,
1029
,
1260
,
1788
,
127
,
1299
,
87
,
1758
,
551
,
1760
,
/* 1100 */
1761
,
547
,
50
,
570
,
1187
,
347
,
1834
,
351
,
247
,
537
,
/* 1110 */
299
,
1830
,
160
,
1788
,
559
,
306
,
88
,
1758
,
551
,
1760
,
/* 1120 */
1761
,
547
,
1900
,
570
,
1056
,
307
,
1834
,
1203
,
253
,
263
,
/* 1130 */
319
,
1830
,
152
,
575
,
1087
,
157
,
1757
,
1250
,
1249
,
1897
,
/* 1140 */
126
,
127
,
266
,
112
,
126
,
399
,
1666
,
168
,
406
,
414
,
/* 1150 */
413
,
415
,
1861
,
419
,
1266
,
420
,
428
,
1269
,
432
,
431
,
/* 1160 */
175
,
177
,
1268
,
433
,
1775
,
1270
,
434
,
1267
,
180
,
137
,
/* 1170 */
436
,
182
,
549
,
1115
,
437
,
184
,
68
,
1727
,
440
,
548
,
/* 1180 */
1119
,
1126
,
459
,
1124
,
130
,
187
,
461
,
91
,
1564
,
191
,
/* 1190 */
1560
,
298
,
1708
,
193
,
132
,
133
,
1562
,
1558
,
264
,
1757
,
/* 1200 */
134
,
204
,
135
,
492
,
493
,
1788
,
207
,
316
,
88
,
1758
,
/* 1210 */
551
,
1760
,
1761
,
547
,
496
,
570
,
499
,
503
,
1834
,
1265
,
/* 1220 */
211
,
513
,
319
,
1830
,
1913
,
1875
,
1757
,
1775
,
1865
,
508
,
/* 1230 */
555
,
510
,
1874
,
1868
,
215
,
549
,
333
,
332
,
218
,
318
,
/* 1240 */
1727
,
516
,
548
,
6
,
509
,
522
,
1252
,
1856
,
223
,
507
,
/* 1250 */
228
,
146
,
506
,
1369
,
1775
,
225
,
118
,
1313
,
1264
,
1245
,
/* 1260 */
320
,
538
,
549
,
1850
,
18
,
124
,
535
,
1727
,
1788
,
548
,
/* 1270 */
125
,
88
,
1758
,
551
,
1760
,
1761
,
547
,
226
,
570
,
227
,
/* 1280 */
1308
,
1834
,
553
,
554
,
1707
,
319
,
1830
,
1913
,
1815
,
1244
,
/* 1290 */
1676
,
1896
,
557
,
328
,
561
,
1788
,
1891
,
1757
,
88
,
1758
,
/* 1300 */
551
,
1760
,
1761
,
547
,
1916
,
570
,
532
,
233
,
1834
,
539
,
/* 1310 */
236
,
560
,
319
,
1830
,
1913
,
238
,
265
,
251
,
562
,
77
,
/* 1320 */
249
,
1575
,
79
,
1853
,
268
,
1775
,
573
,
259
,
571
,
1547
,
/* 1330 */
1618
,
645
,
646
,
549
,
648
,
145
,
270
,
272
,
1727
,
1721
,
/* 1340 */
548
,
289
,
291
,
290
,
1720
,
62
,
1719
,
346
,
1716
,
348
,
/* 1350 */
349
,
51
,
1231
,
1232
,
164
,
529
,
353
,
1714
,
355
,
356
,
/* 1360 */
357
,
1713
,
1757
,
359
,
1712
,
361
,
1788
,
1711
,
1710
,
280
,
/* 1370 */
1758
,
551
,
1760
,
1761
,
547
,
363
,
570
,
365
,
1693
,
165
,
/* 1380 */
368
,
369
,
1206
,
1205
,
1687
,
1686
,
374
,
1253
,
375
,
1248
,
/* 1390 */
1775
,
1685
,
1684
,
1175
,
1659
,
1900
,
1658
,
1657
,
549
,
65
,
/* 1400 */
1656
,
1655
,
1654
,
1727
,
1653
,
548
,
1652
,
388
,
159
,
389
,
/* 1410 */
1651
,
1650
,
1897
,
1256
,
391
,
1649
,
1648
,
1647
,
1646
,
1645
,
/* 1420 */
529
,
1644
,
1643
,
1642
,
568
,
1306
,
1307
,
1309
,
1310
,
1311
,
/* 1430 */
1312
,
1788
,
1641
,
1757
,
280
,
1758
,
551
,
1760
,
1761
,
547
,
/* 1440 */
1640
,
570
,
1639
,
1638
,
1637
,
122
,
1636
,
1635
,
1634
,
1633
,
/* 1450 */
1632
,
1631
,
1177
,
1630
,
1629
,
1757
,
173
,
49
,
424
,
113
,
/* 1460 */
1900
,
1775
,
1628
,
1627
,
1504
,
1472
,
994
,
150
,
1471
,
549
,
/* 1470 */
114
,
993
,
426
,
157
,
1727
,
174
,
548
,
1897
,
1701
,
1695
,
/* 1480 */
1683
,
181
,
1682
,
1775
,
179
,
1668
,
1553
,
1022
,
1503
,
1501
,
/* 1490 */
441
,
549
,
1499
,
1497
,
445
,
1495
,
1727
,
1484
,
548
,
443
,
/* 1500 */
447
,
1483
,
1788
,
1468
,
449
,
89
,
1758
,
551
,
1760
,
1761
,
/* 1510 */
547
,
451
,
570
,
442
,
446
,
1834
,
453
,
450
,
1757
,
1833
,
/* 1520 */
1830
,
454
,
455
,
1555
,
1788
,
190
,
1130
,
89
,
1758
,
551
,
/* 1530 */
1760
,
1761
,
547
,
1129
,
570
,
1554
,
1757
,
1834
,
1493
,
1055
,
/* 1540 */
1054
,
540
,
1830
,
1053
,
1052
,
617
,
1775
,
1049
,
1048
,
619
,
/* 1550 */
1047
,
312
,
1488
,
313
,
546
,
1486
,
478
,
481
,
314
,
1727
,
/* 1560 */
1467
,
548
,
483
,
1466
,
1775
,
485
,
1465
,
487
,
90
,
1700
,
/* 1570 */
1694
,
494
,
549
,
1681
,
1213
,
53
,
136
,
1727
,
495
,
548
,
/* 1580 */
208
,
1679
,
1680
,
1678
,
315
,
1677
,
41
,
1788
,
15
,
1757
,
/* 1590 */
287
,
1758
,
551
,
1760
,
1761
,
547
,
545
,
570
,
542
,
1806
,
/* 1600 */
23
,
47
,
221
,
1409
,
216
,
1788
,
214
,
143
,
89
,
1758
,
/* 1610 */
551
,
1760
,
1761
,
547
,
220
,
570
,
1393
,
1775
,
1834
,
24
,
/* 1620 */
222
,
1747
,
74
,
1831
,
1386
,
549
,
231
,
500
,
45
,
25
,
/* 1630 */
1727
,
46
,
548
,
16
,
1366
,
147
,
1365
,
1426
,
17
,
1415
,
/* 1640 */
1421
,
1420
,
321
,
1757
,
505
,
10
,
1425
,
1424
,
322
,
148
,
/* 1650 */
1301
,
19
,
1284
,
31
,
1757
,
1300
,
1675
,
1667
,
1788
,
12
,
/* 1660 */
1328
,
288
,
1758
,
551
,
1760
,
1761
,
547
,
161
,
570
,
20
,
/* 1670 */
250
,
1775
,
21
,
1746
,
241
,
550
,
1391
,
1223
,
243
,
549
,
/* 1680 */
248
,
255
,
1775
,
13
,
1727
,
1303
,
548
,
1254
,
574
,
80
,
/* 1690 */
549
,
75
,
558
,
252
,
572
,
1727
,
76
,
548
,
1791
,
569
,
/* 1700 */
48
,
1093
,
1116
,
335
,
576
,
578
,
1113
,
579
,
581
,
1110
,
/* 1710 */
582
,
1757
,
1788
,
584
,
585
,
283
,
1758
,
551
,
1760
,
1761
,
/* 1720 */
547
,
1104
,
570
,
1788
,
1102
,
587
,
142
,
1758
,
551
,
1760
,
/* 1730 */
1761
,
547
,
1757
,
570
,
588
,
1108
,
594
,
81
,
1125
,
1775
,
/* 1740 */
1107
,
82
,
1106
,
1105
,
59
,
257
,
1121
,
549
,
1020
,
1044
,
/* 1750 */
1062
,
603
,
1727
,
521
,
548
,
606
,
258
,
1042
,
1041
,
1037
,
/* 1760 */
1775
,
1040
,
1039
,
1038
,
1036
,
1035
,
323
,
1057
,
546
,
1059
,
/* 1770 */
1032
,
1915
,
1500
,
1727
,
1757
,
548
,
1031
,
1030
,
1027
,
1026
,
/* 1780 */
1788
,
1025
,
627
,
288
,
1758
,
551
,
1760
,
1761
,
547
,
629
,
/* 1790 */
570
,
1498
,
628
,
631
,
633
,
632
,
1496
,
1757
,
635
,
636
,
/* 1800 */
637
,
1788
,
1775
,
1494
,
287
,
1758
,
551
,
1760
,
1761
,
547
,
/* 1810 */
549
,
570
,
639
,
1807
,
640
,
1727
,
1482
,
548
,
641
,
643
,
/* 1820 */
984
,
1464
,
261
,
647
,
1439
,
1775
,
1240
,
269
,
650
,
325
,
/* 1830 */
651
,
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
/* 1840 */
548
,
1439
,
1439
,
1788
,
1439
,
1439
,
288
,
1758
,
551
,
1760
,
/* 1850 */
1761
,
547
,
327
,
570
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 1860 */
1439
,
1439
,
1439
,
1439
,
1439
,
1757
,
1788
,
1439
,
1439
,
288
,
/* 1870 */
1758
,
551
,
1760
,
1761
,
547
,
1439
,
570
,
1439
,
1439
,
1757
,
/* 1880 */
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 1890 */
549
,
1439
,
1439
,
1775
,
1439
,
1727
,
1439
,
548
,
1439
,
1439
,
/* 1900 */
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
1727
,
1775
,
548
,
1439
,
/* 1910 */
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
/* 1920 */
1727
,
1757
,
548
,
1788
,
1439
,
1439
,
274
,
1758
,
551
,
1760
,
/* 1930 */
1761
,
547
,
1439
,
570
,
1788
,
1757
,
1439
,
275
,
1758
,
551
,
/* 1940 */
1760
,
1761
,
547
,
1439
,
570
,
1439
,
1757
,
1439
,
1788
,
1775
,
/* 1950 */
1439
,
276
,
1758
,
551
,
1760
,
1761
,
547
,
549
,
570
,
1439
,
/* 1960 */
1439
,
1439
,
1727
,
1775
,
548
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 1970 */
1439
,
549
,
1439
,
1439
,
1775
,
1439
,
1727
,
1439
,
548
,
1439
,
/* 1980 */
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
1727
,
1757
,
548
,
/* 1990 */
1788
,
1439
,
1439
,
282
,
1758
,
551
,
1760
,
1761
,
547
,
1439
,
/* 2000 */
570
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
284
,
1758
,
551
,
/* 2010 */
1760
,
1761
,
547
,
1439
,
570
,
1788
,
1775
,
1439
,
277
,
1758
,
/* 2020 */
551
,
1760
,
1761
,
547
,
549
,
570
,
1439
,
1439
,
1439
,
1727
,
/* 2030 */
1757
,
548
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2040 */
1439
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2050 */
1439
,
1439
,
1439
,
1757
,
1439
,
1439
,
1439
,
1788
,
1775
,
1439
,
/* 2060 */
285
,
1758
,
551
,
1760
,
1761
,
547
,
549
,
570
,
1439
,
1775
,
/* 2070 */
1439
,
1727
,
1439
,
548
,
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
/* 2080 */
1439
,
1775
,
1727
,
1439
,
548
,
1439
,
1439
,
1439
,
1439
,
549
,
/* 2090 */
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
548
,
1439
,
1439
,
1788
,
/* 2100 */
1439
,
1439
,
278
,
1758
,
551
,
1760
,
1761
,
547
,
1757
,
570
,
/* 2110 */
1788
,
1439
,
1439
,
286
,
1758
,
551
,
1760
,
1761
,
547
,
1439
,
/* 2120 */
570
,
1439
,
1788
,
1439
,
1439
,
279
,
1758
,
551
,
1760
,
1761
,
/* 2130 */
547
,
1439
,
570
,
1439
,
1439
,
1757
,
1775
,
1439
,
1439
,
1439
,
/* 2140 */
1439
,
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
1727
,
/* 2150 */
1439
,
548
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2160 */
1439
,
1439
,
1757
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2170 */
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
1727
,
1788
,
548
,
1439
,
/* 2180 */
292
,
1758
,
551
,
1760
,
1761
,
547
,
1439
,
570
,
1439
,
1757
,
/* 2190 */
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
1439
,
/* 2200 */
1439
,
1439
,
1439
,
1727
,
1788
,
548
,
1439
,
293
,
1758
,
551
,
/* 2210 */
1760
,
1761
,
547
,
1439
,
570
,
1439
,
1439
,
1775
,
1439
,
1439
,
/* 2220 */
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
/* 2230 */
1727
,
1788
,
548
,
1439
,
1769
,
1758
,
551
,
1760
,
1761
,
547
,
/* 2240 */
1439
,
570
,
1439
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2250 */
1439
,
1439
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
/* 2260 */
1439
,
1768
,
1758
,
551
,
1760
,
1761
,
547
,
1439
,
570
,
1439
,
/* 2270 */
1757
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
/* 2280 */
1775
,
1439
,
1439
,
1439
,
1727
,
1439
,
548
,
1439
,
549
,
1439
,
/* 2290 */
1439
,
1439
,
1439
,
1727
,
1439
,
548
,
1439
,
1439
,
1775
,
1439
,
/* 2300 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
/* 2310 */
1439
,
1727
,
1788
,
548
,
1439
,
1767
,
1758
,
551
,
1760
,
1761
,
/* 2320 */
547
,
1788
,
570
,
1757
,
303
,
1758
,
551
,
1760
,
1761
,
547
,
/* 2330 */
1439
,
570
,
1439
,
1439
,
1439
,
1439
,
1439
,
1757
,
1439
,
1788
,
/* 2340 */
1439
,
1439
,
302
,
1758
,
551
,
1760
,
1761
,
547
,
1439
,
570
,
/* 2350 */
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
/* 2360 */
1439
,
1439
,
1439
,
1439
,
1727
,
1775
,
548
,
1439
,
1439
,
1439
,
/* 2370 */
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
/* 2380 */
548
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2390 */
1439
,
1757
,
1788
,
1439
,
1439
,
304
,
1758
,
551
,
1760
,
1761
,
/* 2400 */
547
,
1439
,
570
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
301
,
/* 2410 */
1758
,
551
,
1760
,
1761
,
547
,
1439
,
570
,
1439
,
1439
,
1775
,
/* 2420 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
549
,
1439
,
1439
,
/* 2430 */
1439
,
1439
,
1727
,
1439
,
548
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2440 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2450 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2460 */
1788
,
1439
,
1439
,
281
,
1758
,
551
,
1760
,
1761
,
547
,
1439
,
/* 2470 */
570
,
/* 900 */
1727
,
381
,
380
,
1727
,
1244
,
27
,
1445
,
11
,
10
,
139
,
/* 910 */
619
,
34
,
33
,
1727
,
273
,
41
,
39
,
37
,
36
,
35
,
/* 920 */
1549
,
196
,
1435
,
1436
,
195
,
1239
,
227
,
1237
,
271
,
57
,
/* 930 */
1444
,
1492
,
56
,
1443
,
198
,
200
,
42
,
197
,
199
,
558
,
/* 940 */
1532
,
1747
,
214
,
649
,
1757
,
595
,
1250
,
1727
,
172
,
250
,
/* 950 */
367
,
1242
,
1243
,
475
,
1291
,
1292
,
1294
,
1295
,
1296
,
1297
,
/* 960 */
1298
,
564
,
560
,
1306
,
1307
,
1309
,
1310
,
1311
,
1312
,
1314
,
/* 970 */
1317
,
1727
,
1775
,
60
,
1727
,
123
,
1187
,
1749
,
554
,
1293
,
/* 980 */
569
,
491
,
218
,
29
,
1487
,
1727
,
1485
,
568
,
137
,
34
,
/* 990 */
33
,
457
,
126
,
41
,
39
,
37
,
36
,
35
,
127
,
50
,
/* 1000 */
231
,
546
,
1239
,
42
,
1237
,
42
,
477
,
1249
,
480
,
42
,
/* 1010 */
239
,
86
,
1788
,
575
,
602
,
510
,
87
,
1758
,
571
,
1760
,
/* 1020 */
1761
,
567
,
1757
,
562
,
1481
,
1776
,
1834
,
342
,
1242
,
1243
,
/* 1030 */
300
,
1830
,
224
,
129
,
128
,
599
,
598
,
597
,
1087
,
1394
,
/* 1040 */
234
,
126
,
1900
,
1343
,
127
,
1299
,
64
,
63
,
376
,
266
,
/* 1050 */
1775
,
166
,
112
,
1115
,
83
,
157
,
1028
,
370
,
545
,
1897
,
/* 1060 */
1476
,
1614
,
126
,
1727
,
80
,
568
,
1864
,
542
,
244
,
1327
,
/* 1070 */
295
,
249
,
644
,
360
,
252
,
358
,
354
,
350
,
163
,
345
,
/* 1080 */
254
,
1119
,
3
,
1757
,
1126
,
5
,
1029
,
1260
,
347
,
344
,
/* 1090 */
1788
,
351
,
1124
,
306
,
88
,
1758
,
571
,
1760
,
1761
,
567
,
/* 1100 */
1757
,
562
,
130
,
1056
,
1834
,
307
,
1203
,
263
,
326
,
1830
,
/* 1110 */
152
,
1775
,
160
,
399
,
1666
,
168
,
406
,
413
,
414
,
545
,
/* 1120 */
415
,
419
,
156
,
1266
,
1727
,
420
,
568
,
428
,
1775
,
1269
,
/* 1130 */
1860
,
175
,
431
,
177
,
1268
,
432
,
569
,
433
,
1270
,
180
,
/* 1140 */
434
,
1727
,
436
,
568
,
182
,
1267
,
184
,
437
,
68
,
440
,
/* 1150 */
187
,
1788
,
461
,
1757
,
459
,
88
,
1758
,
571
,
1760
,
1761
,
/* 1160 */
567
,
1564
,
562
,
492
,
264
,
1834
,
124
,
191
,
1788
,
326
,
/* 1170 */
1830
,
152
,
88
,
1758
,
571
,
1760
,
1761
,
567
,
298
,
562
,
/* 1180 */
91
,
1775
,
1834
,
1560
,
193
,
132
,
326
,
1830
,
1913
,
569
,
/* 1190 */
133
,
1861
,
1562
,
1558
,
1727
,
134
,
568
,
1868
,
135
,
324
,
/* 1200 */
323
,
1708
,
204
,
207
,
493
,
499
,
496
,
503
,
1757
,
1252
,
/* 1210 */
525
,
211
,
506
,
511
,
1707
,
316
,
512
,
220
,
1676
,
508
,
/* 1220 */
1313
,
1788
,
1245
,
318
,
222
,
88
,
1758
,
571
,
1760
,
1761
,
/* 1230 */
567
,
125
,
562
,
513
,
76
,
1834
,
1775
,
265
,
1575
,
326
,
/* 1240 */
1830
,
1913
,
1265
,
1308
,
569
,
1865
,
521
,
529
,
1875
,
1727
,
/* 1250 */
1891
,
568
,
1244
,
1874
,
1856
,
229
,
538
,
523
,
233
,
524
,
/* 1260 */
325
,
532
,
6
,
522
,
520
,
519
,
1369
,
119
,
1264
,
552
,
/* 1270 */
555
,
19
,
1757
,
146
,
238
,
243
,
1788
,
1850
,
327
,
78
,
/* 1280 */
88
,
1758
,
571
,
1760
,
1761
,
567
,
1757
,
562
,
240
,
242
,
/* 1290 */
1834
,
526
,
241
,
248
,
326
,
1830
,
1913
,
1896
,
1757
,
573
,
/* 1300 */
1775
,
1618
,
268
,
549
,
645
,
1853
,
1547
,
251
,
569
,
556
,
/* 1310 */
1916
,
253
,
259
,
1727
,
1775
,
568
,
646
,
1815
,
648
,
51
,
/* 1320 */
145
,
270
,
569
,
272
,
1721
,
281
,
1775
,
1727
,
291
,
568
,
/* 1330 */
290
,
1720
,
62
,
1719
,
569
,
346
,
1716
,
348
,
349
,
1727
,
/* 1340 */
1788
,
568
,
1231
,
546
,
284
,
1758
,
571
,
1760
,
1761
,
567
,
/* 1350 */
1253
,
562
,
1248
,
1232
,
1788
,
546
,
164
,
353
,
280
,
1758
,
/* 1360 */
571
,
1760
,
1761
,
567
,
1714
,
562
,
1788
,
1757
,
357
,
355
,
/* 1370 */
280
,
1758
,
571
,
1760
,
1761
,
567
,
1256
,
562
,
356
,
1713
,
/* 1380 */
1712
,
359
,
537
,
361
,
1900
,
1711
,
1710
,
560
,
1306
,
1307
,
/* 1390 */
1309
,
1310
,
1311
,
1312
,
363
,
1775
,
1900
,
159
,
365
,
1693
,
/* 1400 */
368
,
1897
,
165
,
569
,
369
,
1206
,
1205
,
1687
,
1727
,
157
,
/* 1410 */
568
,
1686
,
374
,
1897
,
375
,
1685
,
1684
,
1175
,
1659
,
1658
,
/* 1420 */
1657
,
65
,
1656
,
1655
,
1757
,
1654
,
1653
,
1652
,
388
,
389
,
/* 1430 */
1651
,
391
,
1650
,
1649
,
1648
,
1788
,
1647
,
1646
,
1645
,
89
,
/* 1440 */
1758
,
571
,
1760
,
1761
,
567
,
1757
,
562
,
1644
,
1643
,
1834
,
/* 1450 */
1642
,
1641
,
1775
,
1833
,
1830
,
1640
,
1639
,
1638
,
1637
,
122
,
/* 1460 */
569
,
1636
,
1635
,
1634
,
1633
,
1727
,
1632
,
568
,
1631
,
1630
,
/* 1470 */
1629
,
1177
,
1628
,
1775
,
150
,
424
,
1471
,
173
,
113
,
994
,
/* 1480 */
174
,
566
,
1627
,
1504
,
1472
,
993
,
1727
,
426
,
568
,
1701
,
/* 1490 */
1695
,
114
,
1788
,
179
,
181
,
1682
,
89
,
1758
,
571
,
1760
,
/* 1500 */
1761
,
567
,
1683
,
562
,
1668
,
1757
,
1834
,
1553
,
1503
,
1501
,
/* 1510 */
557
,
1830
,
441
,
1788
,
443
,
1499
,
1497
,
288
,
1758
,
571
,
/* 1520 */
1760
,
1761
,
567
,
565
,
562
,
559
,
1806
,
1022
,
442
,
445
,
/* 1530 */
447
,
449
,
446
,
1775
,
450
,
1495
,
451
,
455
,
453
,
454
,
/* 1540 */
1484
,
569
,
1483
,
1468
,
1555
,
1130
,
1727
,
1129
,
568
,
190
,
/* 1550 */
49
,
1554
,
1055
,
1054
,
1053
,
1052
,
617
,
619
,
1049
,
1048
,
/* 1560 */
1493
,
1757
,
1047
,
312
,
1488
,
1486
,
481
,
313
,
314
,
1467
,
/* 1570 */
478
,
483
,
1466
,
1788
,
485
,
1465
,
487
,
142
,
1758
,
571
,
/* 1580 */
1760
,
1761
,
567
,
1757
,
562
,
1700
,
90
,
1213
,
1694
,
1775
,
/* 1590 */
136
,
1681
,
53
,
494
,
495
,
1679
,
315
,
569
,
1680
,
1678
,
/* 1600 */
208
,
1677
,
1727
,
1675
,
568
,
213
,
1223
,
1667
,
15
,
221
,
/* 1610 */
219
,
1775
,
74
,
226
,
75
,
16
,
317
,
42
,
1254
,
569
,
/* 1620 */
1409
,
547
,
1914
,
48
,
1727
,
500
,
568
,
509
,
17
,
1788
,
/* 1630 */
80
,
24
,
223
,
89
,
1758
,
571
,
1760
,
1761
,
567
,
228
,
/* 1640 */
562
,
230
,
1391
,
1834
,
1757
,
232
,
237
,
236
,
1831
,
13
,
/* 1650 */
143
,
1788
,
1747
,
26
,
246
,
289
,
1758
,
571
,
1760
,
1761
,
/* 1660 */
567
,
235
,
562
,
25
,
1757
,
1393
,
1386
,
1366
,
79
,
47
,
/* 1670 */
1365
,
1746
,
1775
,
147
,
18
,
1426
,
1415
,
518
,
1421
,
10
,
/* 1680 */
569
,
1420
,
328
,
1425
,
1424
,
1727
,
329
,
568
,
1328
,
1284
,
/* 1690 */
572
,
1791
,
1775
,
20
,
1303
,
561
,
32
,
46
,
1301
,
1300
,
/* 1700 */
569
,
148
,
161
,
12
,
21
,
1727
,
22
,
568
,
574
,
335
,
/* 1710 */
578
,
1116
,
1788
,
1113
,
576
,
579
,
289
,
1758
,
571
,
1760
,
/* 1720 */
1761
,
567
,
1110
,
562
,
570
,
581
,
584
,
582
,
587
,
1757
,
/* 1730 */
1093
,
594
,
1788
,
1125
,
1121
,
1104
,
142
,
1758
,
571
,
1760
,
/* 1740 */
1761
,
567
,
585
,
562
,
1102
,
588
,
1108
,
1107
,
1757
,
1020
,
/* 1750 */
81
,
82
,
59
,
257
,
603
,
1044
,
606
,
1775
,
258
,
1106
,
/* 1760 */
1105
,
1062
,
330
,
1042
,
1041
,
569
,
1040
,
1039
,
1038
,
1037
,
/* 1770 */
1727
,
1036
,
568
,
1035
,
1059
,
1057
,
1775
,
1032
,
1031
,
1030
,
/* 1780 */
1027
,
1915
,
1500
,
1026
,
566
,
1025
,
627
,
1498
,
628
,
1727
,
/* 1790 */
631
,
568
,
629
,
632
,
1496
,
633
,
635
,
1788
,
637
,
636
,
/* 1800 */
1494
,
289
,
1758
,
571
,
1760
,
1761
,
567
,
639
,
562
,
640
,
/* 1810 */
641
,
1482
,
643
,
984
,
1464
,
261
,
1788
,
1757
,
647
,
650
,
/* 1820 */
288
,
1758
,
571
,
1760
,
1761
,
567
,
1240
,
562
,
269
,
1807
,
/* 1830 */
651
,
1439
,
1439
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 1840 */
1439
,
1439
,
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
/* 1850 */
332
,
1439
,
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
/* 1860 */
568
,
1775
,
1439
,
1439
,
1439
,
1439
,
334
,
1439
,
1439
,
569
,
/* 1870 */
1439
,
1439
,
1439
,
1439
,
1727
,
1757
,
568
,
1439
,
1439
,
1439
,
/* 1880 */
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
1439
,
289
,
/* 1890 */
1758
,
571
,
1760
,
1761
,
567
,
1439
,
562
,
1439
,
1439
,
1757
,
/* 1900 */
1439
,
1788
,
1439
,
1775
,
1439
,
289
,
1758
,
571
,
1760
,
1761
,
/* 1910 */
567
,
569
,
562
,
1439
,
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
/* 1920 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
/* 1930 */
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
/* 1940 */
1727
,
1757
,
568
,
1788
,
1439
,
1439
,
1439
,
274
,
1758
,
571
,
/* 1950 */
1760
,
1761
,
567
,
1439
,
562
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 1960 */
1439
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1775
,
/* 1970 */
1439
,
275
,
1758
,
571
,
1760
,
1761
,
567
,
569
,
562
,
1439
,
/* 1980 */
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
1439
,
1439
,
1439
,
1775
,
/* 1990 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
/* 2000 */
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
1439
,
1439
,
1439
,
1788
,
/* 2010 */
1439
,
1439
,
1439
,
276
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
/* 2020 */
562
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
/* 2030 */
1439
,
1439
,
1439
,
283
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
/* 2040 */
562
,
1439
,
1439
,
1439
,
1439
,
1757
,
1439
,
1439
,
1439
,
1775
,
/* 2050 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
/* 2060 */
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2070 */
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2080 */
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
568
,
1788
,
/* 2090 */
1439
,
1439
,
1439
,
285
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
/* 2100 */
562
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2110 */
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
1439
,
277
,
1758
,
571
,
/* 2120 */
1760
,
1761
,
567
,
1439
,
562
,
1757
,
1439
,
1439
,
1439
,
1775
,
/* 2130 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
/* 2140 */
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2150 */
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2160 */
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1757
,
568
,
1788
,
/* 2170 */
1439
,
1439
,
1439
,
286
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
/* 2180 */
562
,
1439
,
1439
,
1757
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2190 */
1439
,
1439
,
1439
,
1788
,
1439
,
1775
,
1439
,
278
,
1758
,
571
,
/* 2200 */
1760
,
1761
,
567
,
569
,
562
,
1439
,
1439
,
1439
,
1727
,
1439
,
/* 2210 */
568
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
/* 2220 */
1439
,
1439
,
1439
,
1439
,
1727
,
1757
,
568
,
1439
,
1439
,
1439
,
/* 2230 */
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
1439
,
287
,
/* 2240 */
1758
,
571
,
1760
,
1761
,
567
,
1757
,
562
,
1439
,
1439
,
1439
,
/* 2250 */
1439
,
1788
,
1439
,
1775
,
1439
,
279
,
1758
,
571
,
1760
,
1761
,
/* 2260 */
567
,
569
,
562
,
1439
,
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
/* 2270 */
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2280 */
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
/* 2290 */
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
1439
,
292
,
1758
,
571
,
/* 2300 */
1760
,
1761
,
567
,
1439
,
562
,
1757
,
1439
,
1439
,
1439
,
1439
,
/* 2310 */
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
1439
,
293
,
1758
,
571
,
/* 2320 */
1760
,
1761
,
567
,
1439
,
562
,
1439
,
1439
,
1439
,
1439
,
1757
,
/* 2330 */
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2340 */
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
/* 2350 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
/* 2360 */
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
/* 2370 */
1727
,
1439
,
568
,
1788
,
1439
,
1439
,
1439
,
1769
,
1758
,
571
,
/* 2380 */
1760
,
1761
,
567
,
1439
,
562
,
1757
,
1439
,
1439
,
1439
,
1439
,
/* 2390 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
/* 2400 */
1439
,
1768
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
562
,
1757
,
/* 2410 */
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
/* 2420 */
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1439
,
568
,
1439
,
/* 2430 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
/* 2440 */
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
/* 2450 */
1727
,
1757
,
568
,
1788
,
1439
,
1439
,
1439
,
1767
,
1758
,
571
,
/* 2460 */
1760
,
1761
,
567
,
1439
,
562
,
1439
,
1439
,
1757
,
1439
,
1439
,
/* 2470 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1775
,
/* 2480 */
1439
,
304
,
1758
,
571
,
1760
,
1761
,
567
,
569
,
562
,
1439
,
/* 2490 */
1439
,
1439
,
1727
,
1439
,
568
,
1775
,
1439
,
1439
,
1439
,
1439
,
/* 2500 */
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
1727
,
1757
,
/* 2510 */
568
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
/* 2520 */
1439
,
1439
,
1439
,
303
,
1758
,
571
,
1760
,
1761
,
567
,
1757
,
/* 2530 */
562
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1775
,
1439
,
305
,
/* 2540 */
1758
,
571
,
1760
,
1761
,
567
,
569
,
562
,
1439
,
1439
,
1439
,
/* 2550 */
1727
,
1439
,
568
,
1439
,
1439
,
1439
,
1439
,
1775
,
1439
,
1439
,
/* 2560 */
1439
,
1439
,
1439
,
1439
,
1439
,
569
,
1439
,
1439
,
1439
,
1439
,
/* 2570 */
1727
,
1439
,
568
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
/* 2580 */
1439
,
302
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
562
,
1439
,
/* 2590 */
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1439
,
1788
,
1439
,
1439
,
/* 2600 */
1439
,
282
,
1758
,
571
,
1760
,
1761
,
567
,
1439
,
562
,
};
static
const
YYCODETYPE
yy_lookahead
[]
=
{
/* 0 */
259
,
308
,
261
,
262
,
311
,
285
,
252
,
259
,
288
,
261
,
/* 10 */
26
2
,
284
,
12
,
13
,
0
,
294
,
296
,
267
,
297
,
298
,
/* 20 */
20
,
0
,
22
,
285
,
353
,
285
,
288
,
263
,
313
,
263
,
/* 30 */
280
,
0
,
283
,
33
,
296
,
35
,
296
,
366
,
0
,
289
,
/* 40 */
291
,
370
,
21
,
323
,
324
,
24
,
25
,
26
,
27
,
28
,
/* 50 */
29
,
30
,
31
,
32
,
334
,
291
,
56
,
4
,
255
,
59
,
/* 60 */
4
,
323
,
324
,
323
,
324
,
65
,
300
,
313
,
353
,
12
,
/* 70 */
13
,
14
,
334
,
58
,
334
,
61
,
62
,
20
,
329
,
22
,
/* 80 */
66
,
366
,
82
,
69
,
70
,
370
,
283
,
73
,
74
,
75
,
/* 90 */
33
,
20
,
35
,
22
,
291
,
331
,
58
,
44
,
45
,
296
,
/* 100 */
4
,
298
,
14
,
37
,
104
,
20
,
35
,
353
,
20
,
345
,
/* 110 */
3
46
,
347
,
348
,
56
,
350
,
19
,
59
,
298
,
118
,
119
,
/* 120 */
366
,
50
,
65
,
0
,
370
,
306
,
76
,
324
,
309
,
33
,
/* 130 */
3
27
,
328
,
329
,
330
,
331
,
332
,
82
,
334
,
82
,
82
,
/* 140 */
33
7
,
263
,
56
,
47
,
341
,
342
,
343
,
51
,
338
,
339
,
/* 150 */
19
,
85
,
56
,
87
,
88
,
254
,
90
,
256
,
355
,
26
0
,
/* 160 */
94
,
104
,
263
,
163
,
33
,
165
,
363
,
82
,
82
,
291
,
/* 170 */
84
,
275
,
122
,
123
,
20
,
118
,
119
,
81
,
47
,
283
,
/* 180 */
84
,
58
,
116
,
52
,
53
,
54
,
55
,
56
,
292
,
189
,
/* 190 */
190
,
20
,
192
,
193
,
194
,
195
,
196
,
197
,
198
,
199
,
/* 200 */
200
,
201
,
202
,
203
,
204
,
205
,
206
,
207
,
208
,
331
,
/* 210 */
20
,
308
,
81
,
14
,
311
,
84
,
162
,
56
,
164
,
20
,
/* 220 */
163
,
221
,
165
,
14
,
346
,
347
,
348
,
353
,
350
,
20
,
/* 230 */
285
,
8
,
9
,
313
,
20
,
12
,
13
,
14
,
15
,
16
,
/* 240 */
366
,
296
,
81
,
263
,
370
,
84
,
189
,
190
,
117
,
192
,
/* 0 */
259
,
284
,
261
,
262
,
353
,
259
,
252
,
261
,
262
,
267
,
/* 10 */
26
7
,
263
,
12
,
13
,
285
,
268
,
283
,
366
,
263
,
272
,
/* 20 */
20
,
370
,
22
,
280
,
291
,
296
,
12
,
13
,
14
,
15
,
/* 30 */
16
,
289
,
289
,
33
,
21
,
35
,
285
,
24
,
25
,
26
,
/* 40 */
27
,
28
,
29
,
30
,
31
,
32
,
291
,
296
,
300
,
20
,
/* 50 */
285
,
322
,
323
,
324
,
294
,
255
,
56
,
297
,
298
,
59
,
/* 60 */
20
,
296
,
329
,
334
,
58
,
65
,
312
,
312
,
20
,
12
,
/* 70 */
13
,
14
,
263
,
322
,
323
,
0
,
353
,
20
,
254
,
22
,
/* 80 */
256
,
56
,
82
,
283
,
20
,
334
,
331
,
322
,
323
,
366
,
/* 90 */
33
,
291
,
35
,
370
,
312
,
94
,
296
,
353
,
298
,
334
,
/* 100 */
291
,
346
,
347
,
348
,
104
,
350
,
81
,
353
,
353
,
84
,
/* 110 */
3
66
,
82
,
312
,
56
,
370
,
35
,
59
,
116
,
118
,
119
,
/* 120 */
366
,
366
,
65
,
323
,
370
,
370
,
20
,
327
,
328
,
329
,
/* 130 */
3
30
,
331
,
332
,
58
,
334
,
353
,
82
,
337
,
14
,
82
,
/* 140 */
33
1
,
341
,
342
,
263
,
20
,
65
,
82
,
20
,
366
,
282
,
/* 150 */
19
,
56
,
370
,
353
,
345
,
346
,
347
,
348
,
20
,
35
0
,
/* 160 */
22
,
104
,
295
,
163
,
33
,
165
,
366
,
338
,
339
,
4
,
/* 170 */
370
,
291
,
20
,
35
,
275
,
118
,
119
,
82
,
47
,
84
,
/* 180 */
58
,
114
,
283
,
52
,
53
,
54
,
55
,
56
,
50
,
189
,
/* 190 */
190
,
292
,
192
,
193
,
194
,
195
,
196
,
197
,
198
,
199
,
/* 200 */
200
,
201
,
202
,
203
,
204
,
205
,
206
,
207
,
208
,
44
,
/* 210 */
45
,
331
,
81
,
14
,
260
,
84
,
162
,
263
,
164
,
20
,
/* 220 */
163
,
221
,
165
,
76
,
118
,
119
,
346
,
347
,
348
,
20
,
/* 230 */
350
,
8
,
9
,
37
,
298
,
12
,
13
,
14
,
15
,
16
,
/* 240 */
173
,
174
,
306
,
263
,
177
,
309
,
189
,
190
,
117
,
192
,
/* 250 */
193
,
194
,
195
,
196
,
197
,
198
,
199
,
200
,
201
,
202
,
/* 260 */
203
,
204
,
205
,
206
,
207
,
208
,
12
,
13
,
323
,
324
,
/* 270 */
21
,
291
,
313
,
353
,
20
,
221
,
22
,
221
,
267
,
334
,
/* 280 */
149
,
193
,
59
,
34
,
82
,
36
,
366
,
33
,
21
,
35
,
/* 290 */
370
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
/* 300 */
289
,
170
,
282
,
172
,
353
,
298
,
83
,
221
,
118
,
119
,
/* 310 */
56
,
331
,
353
,
59
,
91
,
295
,
309
,
366
,
20
,
65
,
/* 320 */
94
,
370
,
20
,
12
,
13
,
366
,
346
,
347
,
348
,
370
,
/* 330 */
350
,
20
,
58
,
22
,
0
,
20
,
82
,
22
,
20
,
113
,
/* 340 */
114
,
115
,
116
,
117
,
33
,
265
,
35
,
95
,
96
,
97
,
/* 260 */
203
,
204
,
205
,
206
,
207
,
208
,
12
,
13
,
0
,
122
,
/* 270 */
123
,
291
,
283
,
0
,
20
,
221
,
22
,
113
,
114
,
290
,
/* 280 */
149
,
85
,
59
,
87
,
88
,
221
,
90
,
33
,
299
,
35
,
/* 290 */
94
,
148
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
/* 300 */
32
,
170
,
255
,
172
,
263
,
260
,
83
,
263
,
263
,
263
,
/* 310 */
56
,
331
,
116
,
59
,
91
,
274
,
221
,
193
,
274
,
65
,
/* 320 */
274
,
4
,
281
,
12
,
13
,
281
,
346
,
347
,
348
,
82
,
/* 330 */
350
,
20
,
291
,
22
,
0
,
291
,
82
,
291
,
174
,
14
,
/* 340 */
255
,
177
,
65
,
296
,
33
,
20
,
35
,
95
,
96
,
97
,
/* 350 */
98
,
99
,
100
,
101
,
102
,
103
,
104
,
105
,
104
,
107
,
/* 360 */
108
,
109
,
110
,
111
,
112
,
50
,
286
,
56
,
145
,
14
,
/* 370 */
15
,
16
,
118
,
119
,
291
,
255
,
65
,
12
,
13
,
14
,
/* 380 */
1
5
,
16
,
8
,
9
,
82
,
302
,
12
,
13
,
14
,
15
,
/* 390 */
16
,
168
,
193
,
82
,
59
,
61
,
62
,
63
,
64
,
93
,
/* 360 */
108
,
109
,
110
,
111
,
112
,
0
,
263
,
56
,
145
,
226
,
/* 370 */
227
,
293
,
118
,
119
,
296
,
255
,
65
,
274
,
14
,
15
,
/* 380 */
1
6
,
296
,
8
,
9
,
297
,
298
,
12
,
13
,
14
,
15
,
/* 390 */
16
,
168
,
193
,
82
,
291
,
61
,
62
,
63
,
64
,
82
,
/* 400 */
66
,
67
,
68
,
69
,
70
,
71
,
72
,
73
,
74
,
75
,
/* 410 */
76
,
77
,
78
,
79
,
268
,
104
,
296
,
163
,
272
,
165
,
/* 420 */
8
,
9
,
189
,
221
,
12
,
13
,
14
,
15
,
16
,
118
,
/* 410 */
76
,
77
,
78
,
79
,
93
,
104
,
296
,
163
,
325
,
165
,
/* 420 */
8
,
9
,
189
,
58
,
12
,
13
,
14
,
15
,
16
,
118
,
/* 430 */
119
,
0
,
209
,
210
,
211
,
212
,
213
,
214
,
215
,
216
,
/* 440 */
217
,
218
,
293
,
189
,
190
,
296
,
192
,
193
,
194
,
195
,
/* 440 */
217
,
218
,
349
,
189
,
190
,
65
,
192
,
193
,
194
,
195
,
/* 450 */
196
,
197
,
198
,
199
,
200
,
201
,
202
,
203
,
204
,
205
,
/* 460 */
206
,
207
,
208
,
230
,
231
,
232
,
233
,
234
,
35
,
263
,
/* 470 */
61
,
62
,
2
83
,
145
,
163
,
66
,
165
,
20
,
69
,
70
,
/* 480 */
274
,
2
92
,
73
,
74
,
75
,
8
,
9
,
281
,
65
,
12
,
/* 490 */
13
,
14
,
15
,
16
,
65
,
83
,
168
,
291
,
65
,
255
,
/* 500 */
189
,
190
,
114
,
192
,
193
,
194
,
195
,
196
,
197
,
198
,
/* 460 */
206
,
207
,
208
,
230
,
231
,
232
,
233
,
234
,
221
,
263
,
/* 470 */
61
,
62
,
2
69
,
270
,
163
,
66
,
165
,
284
,
69
,
70
,
/* 480 */
274
,
2
65
,
73
,
74
,
75
,
8
,
9
,
1
,
2
,
12
,
/* 490 */
13
,
14
,
15
,
16
,
278
,
83
,
20
,
291
,
22
,
56
,
/* 500 */
189
,
190
,
286
,
192
,
193
,
194
,
195
,
196
,
197
,
198
,
/* 510 */
199
,
200
,
201
,
202
,
203
,
204
,
205
,
206
,
207
,
208
,
/* 520 */
12
,
13
,
14
,
2
21
,
189
,
94
,
297
,
298
,
20
,
155
,
/* 530 */
22
,
2
63
,
221
,
269
,
270
,
33
,
59
,
209
,
113
,
114
,
/* 540 */
29
6
,
33
,
274
,
35
,
113
,
114
,
115
,
116
,
117
,
47
,
/* 550 */
28
4
,
263
,
263
,
283
,
52
,
53
,
54
,
55
,
56
,
291
,
/* 560 */
2
90
,
173
,
174
,
274
,
56
,
177
,
20
,
275
,
91
,
299
,
/* 570 */
281
,
1
,
2
,
65
,
275
,
283
,
317
,
12
,
13
,
291
,
/* 580 */
2
91
,
284
,
283
,
81
,
292
,
20
,
84
,
22
,
8
,
9
,
/* 590 */
82
,
29
2
,
12
,
13
,
14
,
15
,
16
,
265
,
33
,
174
,
/* 600 */
35
,
313
,
177
,
255
,
263
,
263
,
94
,
150
,
283
,
255
,
/* 610 */
2
78
,
255
,
104
,
283
,
263
,
274
,
274
,
243
,
286
,
331
,
/* 620 */
290
,
56
,
145
,
43
,
299
,
274
,
118
,
119
,
116
,
299
,
/* 630 */
65
,
283
,
291
,
291
,
346
,
347
,
348
,
20
,
350
,
291
,
/* 640 */
255
,
353
,
291
,
158
,
296
,
168
,
298
,
82
,
146
,
147
,
/* 650 */
29
6
,
149
,
296
,
83
,
366
,
153
,
8
,
9
,
370
,
148
,
/* 660 */
12
,
13
,
14
,
15
,
16
,
180
,
181
,
260
,
3
,
104
,
/* 670 */
263
,
163
,
324
,
165
,
172
,
327
,
328
,
329
,
330
,
331
,
/* 680 */
332
,
296
,
334
,
118
,
119
,
0
,
209
,
210
,
211
,
212
,
/* 690 */
213
,
214
,
215
,
216
,
217
,
218
,
150
,
189
,
190
,
255
,
/* 520 */
12
,
13
,
14
,
2
75
,
4
,
94
,
50
,
84
,
20
,
155
,
/* 530 */
22
,
2
83
,
221
,
0
,
312
,
33
,
59
,
284
,
221
,
19
,
/* 540 */
29
2
,
33
,
275
,
35
,
113
,
114
,
115
,
116
,
117
,
47
,
/* 550 */
28
3
,
263
,
316
,
33
,
52
,
53
,
54
,
55
,
56
,
292
,
/* 560 */
2
65
,
263
,
274
,
263
,
56
,
269
,
270
,
47
,
91
,
83
,
/* 570 */
312
,
51
,
274
,
65
,
274
,
353
,
56
,
12
,
13
,
291
,
/* 580 */
2
83
,
286
,
263
,
81
,
3
,
20
,
84
,
22
,
366
,
291
,
/* 590 */
82
,
29
1
,
370
,
274
,
61
,
62
,
299
,
158
,
33
,
66
,
/* 600 */
35
,
81
,
69
,
70
,
84
,
263
,
73
,
74
,
75
,
39
,
/* 610 */
2
91
,
353
,
104
,
308
,
263
,
310
,
274
,
243
,
263
,
180
,
/* 620 */
181
,
56
,
145
,
4
,
366
,
274
,
118
,
119
,
370
,
274
,
/* 630 */
65
,
8
,
9
,
291
,
255
,
12
,
13
,
14
,
15
,
16
,
/* 640 */
44
,
45
,
291
,
283
,
255
,
168
,
291
,
82
,
146
,
147
,
/* 650 */
29
0
,
149
,
325
,
20
,
263
,
153
,
8
,
9
,
255
,
299
,
/* 660 */
12
,
13
,
14
,
15
,
16
,
274
,
43
,
291
,
26
3
,
104
,
/* 670 */
308
,
163
,
310
,
165
,
172
,
296
,
349
,
113
,
302
,
274
,
/* 680 */
255
,
43
,
291
,
118
,
119
,
296
,
209
,
210
,
211
,
212
,
/* 690 */
213
,
214
,
215
,
216
,
217
,
218
,
291
,
189
,
190
,
296
,
/* 700 */
192
,
193
,
194
,
195
,
196
,
197
,
198
,
199
,
200
,
201
,
/* 710 */
202
,
203
,
204
,
205
,
206
,
207
,
208
,
0
,
276
,
371
,
/* 720 */
372
,
279
,
263
,
263
,
263
,
269
,
270
,
284
,
163
,
293
,
/* 730 */
165
,
83
,
296
,
274
,
274
,
274
,
284
,
226
,
227
,
0
,
/* 740 */
29
6
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
/* 750 */
2
91
,
291
,
291
,
263
,
189
,
190
,
284
,
192
,
193
,
194
,
/* 710 */
202
,
203
,
204
,
205
,
206
,
207
,
208
,
0
,
8
,
9
,
/* 720 */
21
,
296
,
12
,
13
,
14
,
15
,
16
,
325
,
163
,
293
,
/* 730 */
165
,
83
,
296
,
34
,
276
,
36
,
255
,
279
,
21
,
175
,
/* 740 */
17
6
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
/* 750 */
2
71
,
349
,
273
,
263
,
189
,
190
,
0
,
192
,
193
,
194
,
/* 760 */
195
,
196
,
197
,
198
,
199
,
200
,
201
,
202
,
203
,
204
,
/* 770 */
205
,
206
,
207
,
208
,
12
,
13
,
18
,
22
,
20
,
94
,
/* 780 */
263
,
291
,
20
,
263
,
22
,
27
,
47
,
255
,
30
,
325
,
/* 790 */
35
,
274
,
325
,
284
,
274
,
33
,
4
,
35
,
113
,
114
,
/* 800 */
115
,
116
,
117
,
313
,
255
,
47
,
263
,
49
,
291
,
51
,
/* 810 */
193
,
291
,
113
,
349
,
44
,
45
,
349
,
274
,
56
,
256
,
/* 820 */
65
,
331
,
263
,
39
,
255
,
325
,
272
,
65
,
296
,
219
,
/* 830 */
220
,
255
,
86
,
274
,
291
,
89
,
346
,
347
,
348
,
81
,
/* 840 */
350
,
2
,
373
,
353
,
82
,
296
,
43
,
8
,
9
,
349
,
/* 850 */
291
,
12
,
13
,
14
,
15
,
16
,
366
,
2
,
364
,
104
,
/* 860 */
370
,
42
,
43
,
8
,
9
,
296
,
104
,
12
,
13
,
14
,
/* 870 */
15
,
16
,
2
96
,
264
,
175
,
176
,
255
,
150
,
151
,
121
,
/* 770 */
205
,
206
,
207
,
208
,
12
,
13
,
18
,
296
,
20
,
43
,
/* 780 */
263
,
291
,
20
,
150
,
22
,
27
,
256
,
255
,
30
,
263
,
/* 790 */
220
,
274
,
94
,
83
,
255
,
33
,
20
,
35
,
284
,
298
,
/* 800 */
274
,
145
,
312
,
47
,
255
,
47
,
20
,
49
,
291
,
51
,
/* 810 */
309
,
113
,
114
,
115
,
116
,
117
,
35
,
291
,
56
,
238
,
/* 820 */
263
,
331
,
219
,
220
,
168
,
42
,
43
,
65
,
296
,
150
,
/* 830 */
151
,
274
,
255
,
283
,
255
,
296
,
346
,
347
,
348
,
81
,
/* 840 */
350
,
222
,
292
,
353
,
82
,
296
,
8
,
9
,
291
,
364
,
/* 850 */
12
,
13
,
14
,
15
,
16
,
86
,
366
,
284
,
89
,
255
,
/* 860 */
370
,
22
,
255
,
8
,
9
,
209
,
104
,
12
,
13
,
14
,
/* 870 */
15
,
16
,
2
55
,
296
,
35
,
296
,
284
,
35
,
240
,
121
,
/* 880 */
118
,
119
,
124
,
125
,
126
,
127
,
128
,
129
,
130
,
131
,
/* 890 */
132
,
133
,
134
,
135
,
136
,
137
,
138
,
139
,
140
,
141
,
/* 900 */
0
,
143
,
144
,
238
,
86
,
263
,
255
,
89
,
263
,
18
,
/* 910 */
43
,
271
,
255
,
273
,
23
,
320
,
274
,
296
,
163
,
274
,
/* 920 */
165
,
86
,
22
,
86
,
89
,
163
,
89
,
165
,
37
,
38
,
/* 930 */
1
,
2
,
41
,
291
,
8
,
9
,
291
,
255
,
12
,
13
,
/* 940 */
14
,
15
,
16
,
255
,
189
,
190
,
255
,
296
,
57
,
255
,
/* 950 */
255
,
189
,
190
,
296
,
192
,
193
,
194
,
195
,
196
,
197
,
/* 900 */
296
,
143
,
144
,
296
,
65
,
2
,
255
,
1
,
2
,
18
,
/* 910 */
43
,
8
,
9
,
296
,
23
,
12
,
13
,
14
,
15
,
16
,
/* 920 */
0
,
86
,
118
,
119
,
89
,
163
,
150
,
165
,
37
,
38
,
/* 930 */
255
,
0
,
41
,
255
,
86
,
86
,
43
,
89
,
89
,
59
,
/* 940 */
272
,
46
,
43
,
104
,
255
,
284
,
165
,
296
,
57
,
373
,
/* 950 */
83
,
189
,
190
,
22
,
192
,
193
,
194
,
195
,
196
,
197
,
/* 960 */
198
,
199
,
200
,
201
,
202
,
203
,
204
,
205
,
206
,
207
,
/* 970 */
208
,
283
,
263
,
82
,
263
,
118
,
119
,
56
,
296
,
291
,
/* 980 */
255
,
0
,
360
,
274
,
296
,
274
,
298
,
296
,
8
,
9
,
/* 990 */
296
,
296
,
12
,
13
,
14
,
15
,
16
,
255
,
283
,
43
,
/* 1000 */
291
,
313
,
291
,
22
,
220
,
84
,
46
,
35
,
35
,
83
,
/* 1010 */
43
,
120
,
324
,
43
,
222
,
327
,
328
,
329
,
330
,
331
,
/* 1020 */
332
,
296
,
334
,
0
,
255
,
337
,
262
,
8
,
9
,
341
,
/* 1030 */
342
,
12
,
13
,
14
,
15
,
16
,
0
,
264
,
296
,
83
,
/* 1040 */
295
,
353
,
82
,
240
,
255
,
22
,
155
,
156
,
157
,
43
,
/* 1050 */
83
,
160
,
283
,
83
,
366
,
43
,
82
,
166
,
370
,
326
,
/* 1060 */
291
,
35
,
344
,
351
,
43
,
296
,
92
,
298
,
43
,
367
,
/* 1070 */
179
,
367
,
283
,
182
,
43
,
184
,
185
,
186
,
187
,
188
,
/* 1080 */
291
,
367
,
313
,
354
,
48
,
296
,
223
,
298
,
43
,
83
,
/* 1090 */
322
,
65
,
20
,
324
,
43
,
83
,
327
,
328
,
329
,
330
,
/* 1100 */
331
,
332
,
43
,
334
,
83
,
263
,
337
,
47
,
83
,
242
,
/* 1110 */
341
,
342
,
221
,
324
,
83
,
321
,
327
,
328
,
329
,
330
,
/* 1120 */
331
,
332
,
353
,
334
,
35
,
269
,
337
,
161
,
83
,
315
,
/* 1130 */
341
,
342
,
343
,
43
,
83
,
366
,
255
,
165
,
165
,
370
,
/* 1140 */
43
,
43
,
83
,
43
,
43
,
263
,
263
,
42
,
303
,
145
,
/* 1150 */
301
,
301
,
363
,
263
,
20
,
257
,
257
,
20
,
298
,
319
,
/* 1160 */
267
,
267
,
20
,
312
,
283
,
20
,
314
,
20
,
267
,
150
,
/* 1170 */
312
,
267
,
291
,
83
,
304
,
267
,
267
,
296
,
263
,
298
,
/* 1180 */
83
,
83
,
257
,
83
,
83
,
267
,
283
,
263
,
283
,
283
,
/* 1190 */
283
,
257
,
296
,
283
,
283
,
283
,
283
,
283
,
319
,
255
,
/* 1200 */
283
,
265
,
283
,
171
,
318
,
324
,
265
,
312
,
327
,
328
,
/* 1210 */
329
,
330
,
331
,
332
,
298
,
334
,
263
,
263
,
337
,
20
,
/* 1220 */
265
,
229
,
341
,
342
,
343
,
359
,
255
,
283
,
326
,
296
,
/* 1230 */
228
,
296
,
359
,
352
,
307
,
291
,
12
,
13
,
307
,
296
,
/* 1240 */
296
,
296
,
298
,
235
,
237
,
154
,
22
,
362
,
361
,
236
,
/* 1250 */
322
,
359
,
224
,
220
,
283
,
358
,
291
,
33
,
20
,
35
,
/* 1260 */
244
,
241
,
291
,
325
,
82
,
307
,
239
,
296
,
324
,
298
,
/* 1270 */
307
,
327
,
328
,
329
,
330
,
331
,
332
,
357
,
334
,
356
,
/* 1280 */
56
,
337
,
296
,
296
,
296
,
341
,
342
,
343
,
340
,
65
,
/* 1290 */
296
,
369
,
296
,
296
,
305
,
324
,
352
,
255
,
327
,
328
,
/* 1300 */
329
,
330
,
331
,
332
,
374
,
334
,
369
,
368
,
337
,
369
,
/* 1310 */
368
,
147
,
341
,
342
,
343
,
368
,
279
,
265
,
304
,
265
,
/* 1320 */
291
,
291
,
82
,
352
,
263
,
283
,
287
,
265
,
104
,
273
,
/* 1330 */
296
,
36
,
258
,
291
,
257
,
311
,
266
,
253
,
296
,
0
,
/* 1340 */
298
,
277
,
277
,
277
,
0
,
42
,
0
,
73
,
0
,
35
,
/* 1350 */
183
,
316
,
35
,
35
,
35
,
313
,
183
,
0
,
35
,
35
,
/* 1360 */
183
,
0
,
255
,
183
,
0
,
35
,
324
,
0
,
0
,
327
,
/* 1370 */
328
,
329
,
330
,
331
,
332
,
22
,
334
,
35
,
0
,
82
,
/* 1380 */
168
,
167
,
165
,
163
,
0
,
0
,
159
,
163
,
158
,
165
,
/* 1390 */
283
,
0
,
0
,
46
,
0
,
353
,
0
,
0
,
291
,
142
,
/* 1400 */
0
,
0
,
0
,
296
,
0
,
298
,
0
,
137
,
366
,
35
,
/* 1410 */
0
,
0
,
370
,
189
,
137
,
0
,
0
,
0
,
0
,
0
,
/* 1420 */
313
,
0
,
0
,
0
,
200
,
201
,
202
,
203
,
204
,
205
,
/* 1430 */
206
,
324
,
0
,
255
,
327
,
328
,
329
,
330
,
331
,
332
,
/* 1440 */
0
,
334
,
0
,
0
,
0
,
42
,
0
,
0
,
0
,
0
,
/* 1450 */
0
,
0
,
22
,
0
,
0
,
255
,
42
,
91
,
46
,
39
,
/* 1460 */
353
,
283
,
0
,
0
,
0
,
0
,
14
,
43
,
0
,
291
,
/* 1470 */
39
,
14
,
46
,
366
,
296
,
40
,
298
,
370
,
0
,
0
,
/* 1480 */
0
,
154
,
0
,
283
,
39
,
0
,
0
,
60
,
0
,
0
,
/* 1490 */
35
,
291
,
0
,
0
,
35
,
0
,
296
,
0
,
298
,
39
,
/* 1500 */
39
,
0
,
324
,
0
,
35
,
327
,
328
,
329
,
330
,
331
,
/* 1510 */
332
,
39
,
334
,
47
,
47
,
337
,
35
,
47
,
255
,
341
,
/* 1520 */
342
,
47
,
39
,
0
,
324
,
89
,
35
,
327
,
328
,
329
,
/* 1530 */
330
,
331
,
332
,
22
,
334
,
0
,
255
,
337
,
0
,
35
,
/* 1540 */
35
,
341
,
342
,
35
,
35
,
43
,
283
,
35
,
35
,
43
,
/* 1550 */
35
,
22
,
0
,
22
,
291
,
0
,
49
,
35
,
22
,
296
,
/* 1560 */
0
,
298
,
35
,
0
,
283
,
35
,
0
,
22
,
20
,
0
,
/* 1570 */
0
,
22
,
291
,
0
,
35
,
150
,
169
,
296
,
150
,
298
,
/* 1580 */
147
,
0
,
0
,
0
,
150
,
0
,
43
,
324
,
225
,
255
,
/* 1590 */
327
,
328
,
329
,
330
,
331
,
332
,
333
,
334
,
335
,
336
,
/* 1600 */
82
,
43
,
43
,
83
,
83
,
324
,
82
,
82
,
327
,
328
,
/* 1610 */
329
,
330
,
331
,
332
,
82
,
334
,
83
,
283
,
337
,
82
,
/* 1620 */
46
,
46
,
82
,
342
,
83
,
291
,
46
,
152
,
219
,
43
,
/* 1630 */
296
,
43
,
298
,
225
,
83
,
46
,
83
,
83
,
43
,
83
,
/* 1640 */
35
,
35
,
35
,
255
,
310
,
2
,
35
,
35
,
35
,
46
,
/* 1650 */
83
,
43
,
22
,
82
,
255
,
83
,
0
,
0
,
324
,
82
,
/* 1660 */
189
,
327
,
328
,
329
,
330
,
331
,
332
,
46
,
334
,
82
,
/* 1670 */
39
,
283
,
82
,
46
,
83
,
191
,
83
,
178
,
82
,
291
,
/* 1680 */
82
,
46
,
283
,
225
,
296
,
83
,
298
,
22
,
35
,
92
,
/* 1690 */
291
,
82
,
148
,
146
,
93
,
296
,
82
,
298
,
82
,
82
,
/* 1700 */
82
,
22
,
83
,
35
,
82
,
35
,
83
,
82
,
35
,
83
,
/* 1710 */
82
,
255
,
324
,
35
,
82
,
327
,
328
,
329
,
330
,
331
,
/* 1720 */
332
,
83
,
334
,
324
,
83
,
35
,
327
,
328
,
329
,
330
,
/* 1730 */
331
,
332
,
255
,
334
,
82
,
106
,
94
,
82
,
35
,
283
,
/* 1740 */
106
,
82
,
106
,
106
,
82
,
43
,
22
,
291
,
60
,
35
,
/* 1750 */
65
,
59
,
296
,
365
,
298
,
80
,
43
,
35
,
35
,
22
,
/* 1760 */
283
,
35
,
35
,
35
,
35
,
35
,
310
,
35
,
291
,
65
,
/* 1770 */
35
,
372
,
0
,
296
,
255
,
298
,
35
,
35
,
35
,
35
,
/* 1780 */
324
,
35
,
35
,
327
,
328
,
329
,
330
,
331
,
332
,
39
,
/* 1790 */
334
,
0
,
47
,
35
,
39
,
47
,
0
,
255
,
35
,
47
,
/* 1800 */
39
,
324
,
283
,
0
,
327
,
328
,
329
,
330
,
331
,
332
,
/* 1810 */
291
,
334
,
35
,
336
,
47
,
296
,
0
,
298
,
39
,
35
,
/* 1820 */
35
,
0
,
22
,
21
,
375
,
283
,
22
,
22
,
21
,
310
,
/* 1830 */
20
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
/* 1840 */
298
,
375
,
375
,
324
,
375
,
375
,
327
,
328
,
329
,
330
,
/* 1850 */
331
,
332
,
310
,
334
,
255
,
375
,
375
,
375
,
375
,
375
,
/* 1860 */
375
,
375
,
375
,
375
,
375
,
255
,
324
,
375
,
375
,
327
,
/* 1870 */
328
,
329
,
330
,
331
,
332
,
375
,
334
,
375
,
375
,
255
,
/* 1880 */
375
,
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 1890 */
291
,
375
,
375
,
283
,
375
,
296
,
375
,
298
,
375
,
375
,
/* 1900 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
283
,
298
,
375
,
/* 1910 */
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
/* 1920 */
296
,
255
,
298
,
324
,
375
,
375
,
327
,
328
,
329
,
330
,
/* 1930 */
331
,
332
,
375
,
334
,
324
,
255
,
375
,
327
,
328
,
329
,
/* 1940 */
330
,
331
,
332
,
375
,
334
,
375
,
255
,
375
,
324
,
283
,
/* 1950 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
291
,
334
,
375
,
/* 1960 */
375
,
375
,
296
,
283
,
298
,
375
,
375
,
375
,
375
,
375
,
/* 1970 */
375
,
291
,
375
,
375
,
283
,
375
,
296
,
375
,
298
,
375
,
/* 1980 */
375
,
375
,
291
,
375
,
375
,
375
,
375
,
296
,
255
,
298
,
/* 1990 */
324
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2000 */
334
,
375
,
375
,
375
,
324
,
375
,
375
,
327
,
328
,
329
,
/* 2010 */
330
,
331
,
332
,
375
,
334
,
324
,
283
,
375
,
327
,
328
,
/* 2020 */
329
,
330
,
331
,
332
,
291
,
334
,
375
,
375
,
375
,
296
,
/* 2030 */
255
,
298
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2040 */
375
,
255
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2050 */
375
,
375
,
375
,
255
,
375
,
375
,
375
,
324
,
283
,
375
,
/* 2060 */
327
,
328
,
329
,
330
,
331
,
332
,
291
,
334
,
375
,
283
,
/* 2070 */
375
,
296
,
375
,
298
,
375
,
375
,
375
,
291
,
375
,
375
,
/* 2080 */
375
,
283
,
296
,
375
,
298
,
375
,
375
,
375
,
375
,
291
,
/* 2090 */
375
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
375
,
324
,
/* 2100 */
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
255
,
334
,
/* 2110 */
324
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2120 */
334
,
375
,
324
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
/* 2130 */
332
,
375
,
334
,
375
,
375
,
255
,
283
,
375
,
375
,
375
,
/* 2140 */
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
296
,
/* 2150 */
375
,
298
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2160 */
375
,
375
,
255
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2170 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
324
,
298
,
375
,
/* 2180 */
327
,
328
,
329
,
330
,
331
,
332
,
375
,
334
,
375
,
255
,
/* 2190 */
283
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
375
,
/* 2200 */
375
,
375
,
375
,
296
,
324
,
298
,
375
,
327
,
328
,
329
,
/* 2210 */
330
,
331
,
332
,
375
,
334
,
375
,
375
,
283
,
375
,
375
,
/* 2220 */
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
/* 2230 */
296
,
324
,
298
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
/* 2240 */
375
,
334
,
375
,
255
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2250 */
375
,
375
,
255
,
375
,
375
,
375
,
375
,
375
,
324
,
375
,
/* 2260 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
334
,
375
,
/* 2270 */
255
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
/* 2280 */
283
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
291
,
375
,
/* 2290 */
375
,
375
,
375
,
296
,
375
,
298
,
375
,
375
,
283
,
375
,
/* 2300 */
375
,
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
/* 2310 */
375
,
296
,
324
,
298
,
375
,
327
,
328
,
329
,
330
,
331
,
/* 2320 */
332
,
324
,
334
,
255
,
327
,
328
,
329
,
330
,
331
,
332
,
/* 2330 */
375
,
334
,
375
,
375
,
375
,
375
,
375
,
255
,
375
,
324
,
/* 2340 */
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
334
,
/* 2350 */
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
/* 2360 */
375
,
375
,
375
,
375
,
296
,
283
,
298
,
375
,
375
,
375
,
/* 2370 */
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
/* 2380 */
298
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2390 */
375
,
255
,
324
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
/* 2400 */
332
,
375
,
334
,
375
,
375
,
375
,
324
,
375
,
375
,
327
,
/* 2410 */
328
,
329
,
330
,
331
,
332
,
375
,
334
,
375
,
375
,
283
,
/* 2420 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
/* 2430 */
375
,
375
,
296
,
375
,
298
,
375
,
375
,
375
,
375
,
375
,
/* 2440 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2450 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2460 */
324
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2470 */
334
,
/* 970 */
208
,
296
,
283
,
82
,
296
,
43
,
83
,
82
,
242
,
193
,
/* 980 */
291
,
319
,
83
,
2
,
0
,
296
,
0
,
298
,
150
,
8
,
/* 990 */
9
,
264
,
43
,
12
,
13
,
14
,
15
,
16
,
43
,
43
,
/* 1000 */
43
,
312
,
163
,
43
,
165
,
43
,
22
,
165
,
22
,
43
,
/* 1010 */
360
,
120
,
323
,
43
,
94
,
83
,
327
,
328
,
329
,
330
,
/* 1020 */
331
,
332
,
255
,
334
,
0
,
283
,
337
,
264
,
189
,
190
,
/* 1030 */
341
,
342
,
83
,
113
,
114
,
115
,
116
,
117
,
83
,
83
,
/* 1040 */
83
,
43
,
353
,
83
,
43
,
83
,
155
,
156
,
157
,
83
,
/* 1050 */
283
,
160
,
43
,
83
,
82
,
366
,
35
,
166
,
291
,
370
,
/* 1060 */
262
,
295
,
43
,
296
,
92
,
298
,
326
,
351
,
344
,
189
,
/* 1070 */
179
,
367
,
48
,
182
,
367
,
184
,
185
,
186
,
187
,
188
,
/* 1080 */
367
,
83
,
354
,
255
,
83
,
223
,
65
,
20
,
263
,
321
,
/* 1090 */
323
,
47
,
83
,
320
,
327
,
328
,
329
,
330
,
331
,
332
,
/* 1100 */
255
,
334
,
83
,
35
,
337
,
269
,
161
,
314
,
341
,
342
,
/* 1110 */
343
,
283
,
221
,
263
,
263
,
42
,
303
,
301
,
145
,
291
,
/* 1120 */
301
,
263
,
355
,
20
,
296
,
257
,
298
,
257
,
283
,
20
,
/* 1130 */
363
,
267
,
318
,
267
,
20
,
298
,
291
,
311
,
20
,
267
,
/* 1140 */
313
,
296
,
311
,
298
,
267
,
20
,
267
,
304
,
267
,
263
,
/* 1150 */
267
,
323
,
283
,
255
,
257
,
327
,
328
,
329
,
330
,
331
,
/* 1160 */
332
,
283
,
334
,
171
,
318
,
337
,
307
,
283
,
323
,
341
,
/* 1170 */
342
,
343
,
327
,
328
,
329
,
330
,
331
,
332
,
257
,
334
,
/* 1180 */
263
,
283
,
337
,
283
,
283
,
283
,
341
,
342
,
343
,
291
,
/* 1190 */
283
,
363
,
283
,
283
,
296
,
283
,
298
,
352
,
283
,
12
,
/* 1200 */
13
,
296
,
265
,
265
,
317
,
263
,
298
,
263
,
255
,
22
,
/* 1210 */
228
,
265
,
296
,
147
,
296
,
311
,
305
,
291
,
296
,
296
,
/* 1220 */
33
,
323
,
35
,
296
,
265
,
327
,
328
,
329
,
330
,
331
,
/* 1230 */
332
,
307
,
334
,
304
,
265
,
337
,
283
,
279
,
291
,
341
,
/* 1240 */
342
,
343
,
20
,
56
,
291
,
326
,
296
,
229
,
359
,
296
,
/* 1250 */
352
,
298
,
65
,
359
,
362
,
307
,
154
,
296
,
307
,
296
,
/* 1260 */
296
,
296
,
235
,
237
,
236
,
224
,
220
,
291
,
20
,
239
,
/* 1270 */
241
,
82
,
255
,
359
,
361
,
321
,
323
,
325
,
244
,
82
,
/* 1280 */
327
,
328
,
329
,
330
,
331
,
332
,
255
,
334
,
358
,
356
,
/* 1290 */
337
,
104
,
357
,
368
,
341
,
342
,
343
,
369
,
255
,
287
,
/* 1300 */
283
,
296
,
263
,
369
,
36
,
352
,
273
,
368
,
291
,
369
,
/* 1310 */
374
,
368
,
265
,
296
,
283
,
298
,
258
,
340
,
257
,
315
,
/* 1320 */
310
,
266
,
291
,
253
,
0
,
277
,
283
,
296
,
277
,
298
,
/* 1330 */
277
,
0
,
42
,
0
,
291
,
73
,
0
,
35
,
183
,
296
,
/* 1340 */
323
,
298
,
35
,
312
,
327
,
328
,
329
,
330
,
331
,
332
,
/* 1350 */
163
,
334
,
165
,
35
,
323
,
312
,
35
,
183
,
327
,
328
,
/* 1360 */
329
,
330
,
331
,
332
,
0
,
334
,
323
,
255
,
183
,
35
,
/* 1370 */
327
,
328
,
329
,
330
,
331
,
332
,
189
,
334
,
35
,
0
,
/* 1380 */
0
,
183
,
365
,
35
,
353
,
0
,
0
,
200
,
201
,
202
,
/* 1390 */
203
,
204
,
205
,
206
,
22
,
283
,
353
,
366
,
35
,
0
,
/* 1400 */
168
,
370
,
82
,
291
,
167
,
165
,
163
,
0
,
296
,
366
,
/* 1410 */
298
,
0
,
159
,
370
,
158
,
0
,
0
,
46
,
0
,
0
,
/* 1420 */
0
,
142
,
0
,
0
,
255
,
0
,
0
,
0
,
137
,
35
,
/* 1430 */
0
,
137
,
0
,
0
,
0
,
323
,
0
,
0
,
0
,
327
,
/* 1440 */
328
,
329
,
330
,
331
,
332
,
255
,
334
,
0
,
0
,
337
,
/* 1450 */
0
,
0
,
283
,
341
,
342
,
0
,
0
,
0
,
0
,
42
,
/* 1460 */
291
,
0
,
0
,
0
,
0
,
296
,
0
,
298
,
0
,
0
,
/* 1470 */
0
,
22
,
0
,
283
,
43
,
46
,
0
,
42
,
39
,
14
,
/* 1480 */
40
,
291
,
0
,
0
,
0
,
14
,
296
,
46
,
298
,
0
,
/* 1490 */
0
,
39
,
323
,
39
,
154
,
0
,
327
,
328
,
329
,
330
,
/* 1500 */
331
,
332
,
0
,
334
,
0
,
255
,
337
,
0
,
0
,
0
,
/* 1510 */
341
,
342
,
35
,
323
,
39
,
0
,
0
,
327
,
328
,
329
,
/* 1520 */
330
,
331
,
332
,
333
,
334
,
335
,
336
,
60
,
47
,
35
,
/* 1530 */
39
,
35
,
47
,
283
,
47
,
0
,
39
,
39
,
35
,
47
,
/* 1540 */
0
,
291
,
0
,
0
,
0
,
35
,
296
,
22
,
298
,
89
,
/* 1550 */
91
,
0
,
35
,
35
,
35
,
35
,
43
,
43
,
35
,
35
,
/* 1560 */
0
,
255
,
35
,
22
,
0
,
0
,
35
,
22
,
22
,
0
,
/* 1570 */
49
,
35
,
0
,
323
,
35
,
0
,
22
,
327
,
328
,
329
,
/* 1580 */
330
,
331
,
332
,
255
,
334
,
0
,
20
,
35
,
0
,
283
,
/* 1590 */
169
,
0
,
150
,
22
,
150
,
0
,
150
,
291
,
0
,
0
,
/* 1600 */
147
,
0
,
296
,
0
,
298
,
83
,
178
,
0
,
82
,
39
,
/* 1610 */
82
,
283
,
82
,
46
,
82
,
225
,
288
,
43
,
22
,
291
,
/* 1620 */
83
,
371
,
372
,
43
,
296
,
152
,
298
,
148
,
225
,
323
,
/* 1630 */
92
,
82
,
146
,
327
,
328
,
329
,
330
,
331
,
332
,
82
,
/* 1640 */
334
,
83
,
83
,
337
,
255
,
82
,
46
,
43
,
342
,
225
,
/* 1650 */
82
,
323
,
46
,
43
,
46
,
327
,
328
,
329
,
330
,
331
,
/* 1660 */
332
,
82
,
334
,
82
,
255
,
83
,
83
,
83
,
82
,
43
,
/* 1670 */
83
,
46
,
283
,
46
,
43
,
83
,
83
,
288
,
35
,
2
,
/* 1680 */
291
,
35
,
35
,
35
,
35
,
296
,
35
,
298
,
189
,
22
,
/* 1690 */
93
,
82
,
283
,
43
,
83
,
82
,
82
,
219
,
83
,
83
,
/* 1700 */
291
,
46
,
46
,
82
,
82
,
296
,
82
,
298
,
35
,
35
,
/* 1710 */
35
,
83
,
323
,
83
,
82
,
82
,
327
,
328
,
329
,
330
,
/* 1720 */
331
,
332
,
83
,
334
,
191
,
35
,
35
,
82
,
35
,
255
,
/* 1730 */
22
,
94
,
323
,
35
,
22
,
83
,
327
,
328
,
329
,
330
,
/* 1740 */
331
,
332
,
82
,
334
,
83
,
82
,
106
,
106
,
255
,
60
,
/* 1750 */
82
,
82
,
82
,
43
,
59
,
35
,
80
,
283
,
43
,
106
,
/* 1760 */
106
,
65
,
288
,
35
,
35
,
291
,
35
,
35
,
35
,
22
,
/* 1770 */
296
,
35
,
298
,
35
,
65
,
35
,
283
,
35
,
35
,
35
,
/* 1780 */
35
,
372
,
0
,
35
,
291
,
35
,
35
,
0
,
47
,
296
,
/* 1790 */
35
,
298
,
39
,
47
,
0
,
39
,
35
,
323
,
39
,
47
,
/* 1800 */
0
,
327
,
328
,
329
,
330
,
331
,
332
,
35
,
334
,
47
,
/* 1810 */
39
,
0
,
35
,
35
,
0
,
22
,
323
,
255
,
21
,
21
,
/* 1820 */
327
,
328
,
329
,
330
,
331
,
332
,
22
,
334
,
22
,
336
,
/* 1830 */
20
,
375
,
375
,
255
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 1840 */
375
,
375
,
375
,
375
,
375
,
283
,
375
,
375
,
375
,
375
,
/* 1850 */
288
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
/* 1860 */
298
,
283
,
375
,
375
,
375
,
375
,
288
,
375
,
375
,
291
,
/* 1870 */
375
,
375
,
375
,
375
,
296
,
255
,
298
,
375
,
375
,
375
,
/* 1880 */
375
,
375
,
375
,
375
,
375
,
323
,
375
,
375
,
375
,
327
,
/* 1890 */
328
,
329
,
330
,
331
,
332
,
375
,
334
,
375
,
375
,
255
,
/* 1900 */
375
,
323
,
375
,
283
,
375
,
327
,
328
,
329
,
330
,
331
,
/* 1910 */
332
,
291
,
334
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
/* 1920 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
283
,
375
,
375
,
/* 1930 */
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
/* 1940 */
296
,
255
,
298
,
323
,
375
,
375
,
375
,
327
,
328
,
329
,
/* 1950 */
330
,
331
,
332
,
375
,
334
,
375
,
375
,
375
,
375
,
375
,
/* 1960 */
375
,
255
,
375
,
375
,
375
,
375
,
375
,
323
,
375
,
283
,
/* 1970 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
291
,
334
,
375
,
/* 1980 */
375
,
375
,
296
,
375
,
298
,
375
,
375
,
375
,
375
,
283
,
/* 1990 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
/* 2000 */
375
,
375
,
296
,
375
,
298
,
375
,
375
,
375
,
375
,
323
,
/* 2010 */
375
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2020 */
334
,
255
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
323
,
/* 2030 */
375
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2040 */
334
,
375
,
375
,
375
,
375
,
255
,
375
,
375
,
375
,
283
,
/* 2050 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
/* 2060 */
375
,
375
,
296
,
375
,
298
,
375
,
375
,
375
,
375
,
375
,
/* 2070 */
375
,
375
,
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2080 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
298
,
323
,
/* 2090 */
375
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2100 */
334
,
255
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2110 */
375
,
375
,
375
,
323
,
375
,
375
,
375
,
327
,
328
,
329
,
/* 2120 */
330
,
331
,
332
,
375
,
334
,
255
,
375
,
375
,
375
,
283
,
/* 2130 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
/* 2140 */
375
,
375
,
296
,
375
,
298
,
375
,
375
,
375
,
375
,
375
,
/* 2150 */
375
,
375
,
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2160 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
255
,
298
,
323
,
/* 2170 */
375
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
/* 2180 */
334
,
375
,
375
,
255
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2190 */
375
,
375
,
375
,
323
,
375
,
283
,
375
,
327
,
328
,
329
,
/* 2200 */
330
,
331
,
332
,
291
,
334
,
375
,
375
,
375
,
296
,
375
,
/* 2210 */
298
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
291
,
/* 2220 */
375
,
375
,
375
,
375
,
296
,
255
,
298
,
375
,
375
,
375
,
/* 2230 */
375
,
375
,
375
,
375
,
375
,
323
,
375
,
375
,
375
,
327
,
/* 2240 */
328
,
329
,
330
,
331
,
332
,
255
,
334
,
375
,
375
,
375
,
/* 2250 */
375
,
323
,
375
,
283
,
375
,
327
,
328
,
329
,
330
,
331
,
/* 2260 */
332
,
291
,
334
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
/* 2270 */
375
,
375
,
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2280 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
/* 2290 */
375
,
375
,
375
,
323
,
375
,
375
,
375
,
327
,
328
,
329
,
/* 2300 */
330
,
331
,
332
,
375
,
334
,
255
,
375
,
375
,
375
,
375
,
/* 2310 */
375
,
375
,
375
,
323
,
375
,
375
,
375
,
327
,
328
,
329
,
/* 2320 */
330
,
331
,
332
,
375
,
334
,
375
,
375
,
375
,
375
,
255
,
/* 2330 */
375
,
375
,
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2340 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
/* 2350 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
283
,
375
,
375
,
/* 2360 */
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
/* 2370 */
296
,
375
,
298
,
323
,
375
,
375
,
375
,
327
,
328
,
329
,
/* 2380 */
330
,
331
,
332
,
375
,
334
,
255
,
375
,
375
,
375
,
375
,
/* 2390 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
323
,
375
,
375
,
/* 2400 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
334
,
255
,
/* 2410 */
375
,
375
,
375
,
283
,
375
,
375
,
375
,
375
,
375
,
375
,
/* 2420 */
375
,
291
,
375
,
375
,
375
,
375
,
296
,
375
,
298
,
375
,
/* 2430 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
283
,
375
,
375
,
/* 2440 */
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
/* 2450 */
296
,
255
,
298
,
323
,
375
,
375
,
375
,
327
,
328
,
329
,
/* 2460 */
330
,
331
,
332
,
375
,
334
,
375
,
375
,
255
,
375
,
375
,
/* 2470 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
323
,
375
,
283
,
/* 2480 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
291
,
334
,
375
,
/* 2490 */
375
,
375
,
296
,
375
,
298
,
283
,
375
,
375
,
375
,
375
,
/* 2500 */
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
296
,
255
,
/* 2510 */
298
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
375
,
323
,
/* 2520 */
375
,
375
,
375
,
327
,
328
,
329
,
330
,
331
,
332
,
255
,
/* 2530 */
334
,
375
,
375
,
375
,
375
,
323
,
375
,
283
,
375
,
327
,
/* 2540 */
328
,
329
,
330
,
331
,
332
,
291
,
334
,
375
,
375
,
375
,
/* 2550 */
296
,
375
,
298
,
375
,
375
,
375
,
375
,
283
,
375
,
375
,
/* 2560 */
375
,
375
,
375
,
375
,
375
,
291
,
375
,
375
,
375
,
375
,
/* 2570 */
296
,
375
,
298
,
375
,
375
,
375
,
375
,
323
,
375
,
375
,
/* 2580 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
334
,
375
,
/* 2590 */
375
,
375
,
375
,
375
,
375
,
375
,
375
,
323
,
375
,
375
,
/* 2600 */
375
,
327
,
328
,
329
,
330
,
331
,
332
,
375
,
334
,
};
#define YY_SHIFT_COUNT (652)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (18
21
)
#define YY_SHIFT_MAX (18
14
)
static
const
unsigned
short
int
yy_shift_ofst
[]
=
{
/* 0 */
891
,
0
,
0
,
57
,
57
,
254
,
254
,
254
,
311
,
311
,
/* 10 */
254
,
254
,
508
,
565
,
762
,
565
,
565
,
565
,
565
,
565
,
/* 20 */
565
,
565
,
565
,
565
,
565
,
565
,
565
,
565
,
565
,
565
,
/* 30 */
565
,
565
,
565
,
565
,
565
,
565
,
565
,
565
,
565
,
565
,
/* 40 */
565
,
565
,
302
,
302
,
85
,
85
,
85
,
1224
,
1224
,
1224
,
/* 50 */
1
224
,
54
,
86
,
202
,
154
,
154
,
53
,
53
,
56
,
190
,
/* 60 */
2
02
,
202
,
154
,
154
,
154
,
154
,
154
,
154
,
154
,
154
,
/* 70 */
15
,
154
,
154
,
154
,
171
,
214
,
298
,
154
,
154
,
298
,
/* 80 */
154
,
298
,
298
,
298
,
154
,
274
,
758
,
223
,
477
,
477
,
/* 90 */
267
,
409
,
755
,
755
,
755
,
755
,
755
,
755
,
755
,
755
,
/* 100 */
755
,
755
,
755
,
755
,
755
,
755
,
755
,
755
,
755
,
755
,
/* 110 */
755
,
66
,
190
,
209
,
209
,
38
,
433
,
457
,
457
,
457
,
/* 120 */
123
,
433
,
318
,
214
,
31
,
31
,
298
,
298
,
423
,
423
,
/* 130 */
3
06
,
429
,
252
,
252
,
252
,
252
,
252
,
252
,
252
,
131
,
/* 140 */
21
,
14
,
374
,
233
,
71
,
388
,
511
,
88
,
199
,
315
,
/* 150 */
770
,
512
,
546
,
610
,
784
,
610
,
819
,
665
,
665
,
665
,
/* 160 */
792
,
617
,
863
,
1072
,
1060
,
1089
,
966
,
1072
,
1072
,
1105
,
/* 170 */
1004
,
1004
,
1072
,
1134
,
1134
,
1137
,
15
,
214
,
15
,
1142
,
/* 180 */
11
45
,
15
,
1142
,
15
,
1147
,
15
,
15
,
1072
,
15
,
1134
,
/* 190 */
298
,
298
,
298
,
298
,
298
,
298
,
298
,
298
,
298
,
298
,
/* 200 */
298
,
1072
,
1134
,
423
,
1137
,
274
,
1032
,
214
,
274
,
1072
,
/* 210 */
10
72
,
1142
,
274
,
1199
,
423
,
992
,
1002
,
423
,
992
,
1002
,
/* 220 */
423
,
423
,
298
,
1008
,
1091
,
992
,
1007
,
1013
,
1028
,
863
,
/* 230 */
1033
,
318
,
1238
,
1020
,
1027
,
1016
,
1020
,
1027
,
1020
,
1027
,
/* 240 */
1
182
,
1002
,
423
,
423
,
423
,
423
,
423
,
1002
,
423
,
1164
,
/* 250 */
318
,
1147
,
274
,
306
,
274
,
318
,
1240
,
423
,
429
,
1072
,
/* 260 */
274
,
1295
,
1134
,
2471
,
2471
,
2471
,
2471
,
2471
,
2471
,
2471
,
/* 270 */
334
,
502
,
717
,
96
,
412
,
580
,
648
,
839
,
855
,
1019
,
/* 280 */
926
,
980
,
980
,
980
,
980
,
980
,
980
,
980
,
980
,
431
,
/* 290 */
685
,
226
,
365
,
365
,
425
,
485
,
161
,
50
,
249
,
570
,
/* 300 */
328
,
355
,
355
,
355
,
355
,
699
,
739
,
956
,
746
,
818
,
/* 310 */
8
35
,
837
,
900
,
981
,
1023
,
921
,
727
,
967
,
970
,
929
,
/* 320 */
857
,
803
,
867
,
1006
,
335
,
1012
,
960
,
1021
,
1025
,
1031
,
/* 330 */
1045
,
1051
,
972
,
973
,
1059
,
1090
,
1097
,
1098
,
1100
,
1101
,
/* 340 */
97
4
,
1026
,
1036
,
1339
,
1344
,
1303
,
1346
,
1274
,
1348
,
1314
,
/* 350 */
11
67
,
1317
,
1318
,
1319
,
1173
,
1357
,
1323
,
1324
,
1177
,
1361
,
/* 360 */
11
80
,
1364
,
1330
,
1367
,
1353
,
1368
,
1342
,
1378
,
1297
,
121
2
,
/* 370 */
12
14
,
1217
,
1220
,
1384
,
1385
,
1227
,
1230
,
1391
,
1392
,
1347
,
/* 380 */
1
394
,
1396
,
1397
,
1257
,
1400
,
1401
,
1402
,
1404
,
1406
,
1270
,
/* 390 */
13
74
,
1410
,
1277
,
1411
,
1415
,
1416
,
1417
,
1418
,
1419
,
1421
,
/* 400 */
14
22
,
1423
,
1432
,
1440
,
1442
,
1443
,
1444
,
1403
,
1446
,
1447
,
/* 410 */
14
48
,
1449
,
1450
,
1451
,
1430
,
1453
,
1454
,
1462
,
1463
,
1464
,
/* 420 */
14
65
,
1414
,
1420
,
1424
,
1452
,
1412
,
1457
,
1426
,
1468
,
1435
,
/* 430 */
14
31
,
1478
,
1479
,
1480
,
1445
,
1327
,
1482
,
1485
,
1486
,
142
7
,
/* 440 */
1
488
,
1489
,
1455
,
1466
,
1460
,
1492
,
1459
,
1467
,
1461
,
1493
,
/* 450 */
14
69
,
1470
,
1472
,
1495
,
1481
,
1474
,
1483
,
1497
,
1501
,
150
3
,
/* 460 */
15
23
,
1366
,
1436
,
1491
,
1511
,
1535
,
1504
,
1505
,
1508
,
1509
,
/* 470 */
15
02
,
1506
,
1512
,
1513
,
1515
,
1538
,
1529
,
1552
,
1531
,
1507
,
/* 480 */
15
55
,
1536
,
1522
,
1560
,
1527
,
1563
,
1530
,
1566
,
1545
,
1548
,
/* 490 */
15
69
,
1425
,
1539
,
1570
,
1407
,
1549
,
1428
,
1433
,
1573
,
1581
,
/* 500 */
14
34
,
1475
,
1582
,
1583
,
1585
,
1543
,
1363
,
1518
,
1520
,
1524
,
/* 510 */
1
521
,
1558
,
1533
,
1525
,
1532
,
1537
,
1541
,
1559
,
1574
,
1575
,
/* 520 */
154
0
,
1586
,
1408
,
1551
,
1553
,
1580
,
1409
,
1588
,
1589
,
1554
,
/* 530 */
15
95
,
1458
,
1556
,
1605
,
1606
,
1607
,
1611
,
1612
,
1613
,
1556
,
/* 540 */
1
643
,
1471
,
1608
,
1567
,
1571
,
1572
,
1603
,
1577
,
1587
,
1621
,
/* 550 */
16
30
,
1484
,
1590
,
1591
,
1593
,
1596
,
1499
,
1656
,
1598
,
1544
,
/* 560 */
1609
,
16
57
,
1631
,
1547
,
1614
,
1597
,
1627
,
1635
,
1616
,
1602
,
/* 570 */
16
17
,
1665
,
1618
,
1601
,
1619
,
1653
,
1668
,
1622
,
1623
,
1670
,
/* 580 */
16
25
,
1626
,
1673
,
1628
,
1638
,
1678
,
1632
,
1641
,
1690
,
1652
,
/* 590 */
16
29
,
1634
,
1636
,
1637
,
1679
,
1642
,
1655
,
1659
,
1703
,
1662
,
/* 600 */
17
02
,
1702
,
1724
,
1688
,
1692
,
1714
,
1685
,
1675
,
1713
,
1722
,
/* 610 */
172
3
,
1726
,
1727
,
1728
,
1737
,
1729
,
1730
,
1704
,
1502
,
1732
,
/* 620 */
15
06
,
1735
,
1741
,
1742
,
1743
,
1744
,
1746
,
1772
,
1747
,
1745
,
/* 630 */
175
0
,
1791
,
1758
,
1748
,
1755
,
1796
,
1763
,
1752
,
1761
,
1803
,
/* 640 */
177
7
,
1767
,
1779
,
1816
,
1784
,
1785
,
1821
,
1800
,
1802
,
1804
,
/* 650 */
180
5
,
1807
,
1810
,
/* 40 */
565
,
565
,
565
,
64
,
64
,
29
,
29
,
29
,
1187
,
1187
,
/* 50 */
1
187
,
54
,
95
,
247
,
40
,
40
,
165
,
165
,
317
,
106
,
/* 60 */
2
47
,
247
,
40
,
40
,
40
,
40
,
40
,
40
,
40
,
40
,
/* 70 */
6
,
40
,
40
,
40
,
48
,
127
,
40
,
40
,
127
,
152
,
/* 80 */
40
,
127
,
127
,
127
,
40
,
122
,
758
,
223
,
477
,
477
,
/* 90 */
13
,
409
,
839
,
839
,
839
,
839
,
839
,
839
,
839
,
839
,
/* 100 */
839
,
839
,
839
,
839
,
839
,
839
,
839
,
839
,
839
,
839
,
/* 110 */
839
,
196
,
106
,
325
,
325
,
75
,
80
,
365
,
633
,
633
,
/* 120 */
633
,
80
,
209
,
48
,
273
,
273
,
127
,
127
,
277
,
277
,
/* 130 */
3
21
,
380
,
252
,
252
,
252
,
252
,
252
,
252
,
252
,
131
,
/* 140 */
717
,
533
,
374
,
233
,
138
,
67
,
143
,
124
,
199
,
476
,
/* 150 */
596
,
1
,
776
,
603
,
570
,
603
,
783
,
581
,
581
,
581
,
/* 160 */
619
,
786
,
862
,
1067
,
1044
,
1068
,
945
,
1067
,
1067
,
1073
,
/* 170 */
973
,
973
,
1067
,
1103
,
1103
,
1109
,
6
,
48
,
6
,
1114
,
/* 180 */
11
18
,
6
,
1114
,
6
,
1125
,
6
,
6
,
1067
,
6
,
1103
,
/* 190 */
127
,
127
,
127
,
127
,
127
,
127
,
127
,
127
,
127
,
127
,
/* 200 */
127
,
1067
,
1103
,
277
,
1109
,
122
,
992
,
48
,
122
,
1067
,
/* 210 */
10
67
,
1114
,
122
,
982
,
277
,
277
,
277
,
277
,
982
,
277
,
/* 220 */
1066
,
209
,
1125
,
122
,
321
,
122
,
209
,
1222
,
277
,
1018
,
/* 230 */
982
,
277
,
277
,
1018
,
982
,
277
,
277
,
127
,
1027
,
1102
,
/* 240 */
1
018
,
1026
,
1028
,
1041
,
862
,
1046
,
209
,
1248
,
1029
,
1030
,
/* 250 */
1034
,
1029
,
1030
,
1029
,
1030
,
1189
,
1197
,
277
,
380
,
1067
,
/* 260 */
122
,
1268
,
1103
,
2609
,
2609
,
2609
,
2609
,
2609
,
2609
,
2609
,
/* 270 */
334
,
502
,
268
,
520
,
412
,
623
,
648
,
903
,
981
,
838
,
/* 280 */
710
,
431
,
855
,
855
,
855
,
855
,
855
,
855
,
855
,
855
,
/* 290 */
920
,
698
,
14
,
14
,
164
,
439
,
25
,
147
,
699
,
564
,
/* 300 */
486
,
656
,
364
,
364
,
364
,
364
,
756
,
867
,
769
,
835
,
/* 310 */
8
48
,
849
,
931
,
984
,
986
,
443
,
679
,
893
,
899
,
932
,
/* 320 */
949
,
955
,
956
,
781
,
842
,
957
,
906
,
804
,
638
,
736
,
/* 330 */
960
,
880
,
962
,
895
,
966
,
970
,
998
,
1001
,
1009
,
1019
,
/* 340 */
97
2
,
1021
,
1024
,
1324
,
1331
,
1290
,
1333
,
1262
,
1336
,
1302
,
/* 350 */
11
55
,
1307
,
1318
,
1321
,
1174
,
1364
,
1334
,
1343
,
1185
,
1379
,
/* 360 */
11
98
,
1380
,
1348
,
1385
,
1372
,
1386
,
1363
,
1399
,
1320
,
123
2
,
/* 370 */
12
37
,
1240
,
1243
,
1407
,
1411
,
1253
,
1256
,
1415
,
1416
,
1371
,
/* 380 */
1
418
,
1419
,
1420
,
1279
,
1422
,
1423
,
1425
,
1426
,
1427
,
1291
,
/* 390 */
13
94
,
1430
,
1294
,
1432
,
1433
,
1434
,
1436
,
1437
,
1438
,
1447
,
/* 400 */
14
48
,
1450
,
1451
,
1455
,
1456
,
1457
,
1458
,
1417
,
1461
,
1462
,
/* 410 */
14
63
,
1464
,
1466
,
1468
,
1449
,
1469
,
1470
,
1472
,
1482
,
1483
,
/* 420 */
14
84
,
1435
,
1439
,
1431
,
1465
,
1429
,
1471
,
1441
,
1476
,
1440
,
/* 430 */
14
52
,
1489
,
1490
,
1502
,
1454
,
1340
,
1495
,
1504
,
1507
,
146
7
,
/* 440 */
1
508
,
1509
,
1477
,
1481
,
1475
,
1515
,
1494
,
1485
,
1491
,
1516
,
/* 450 */
14
96
,
1487
,
1497
,
1535
,
1503
,
1492
,
1498
,
1540
,
1542
,
154
3
,
/* 460 */
15
44
,
1459
,
1460
,
1510
,
1525
,
1551
,
1517
,
1518
,
1519
,
1520
,
/* 470 */
15
13
,
1514
,
1523
,
1524
,
1527
,
1560
,
1541
,
1564
,
1545
,
1521
,
/* 480 */
15
65
,
1546
,
1531
,
1569
,
1536
,
1572
,
1539
,
1575
,
1554
,
1566
,
/* 490 */
15
85
,
1442
,
1552
,
1588
,
1421
,
1571
,
1444
,
1453
,
1591
,
1595
,
/* 500 */
14
46
,
1473
,
1598
,
1599
,
1601
,
1526
,
1522
,
1428
,
1603
,
1528
,
/* 510 */
1
479
,
1530
,
1607
,
1570
,
1486
,
1532
,
1538
,
1567
,
1574
,
1390
,
/* 520 */
154
9
,
1537
,
1557
,
1558
,
1559
,
1563
,
1596
,
1580
,
1582
,
1568
,
/* 530 */
15
79
,
1581
,
1583
,
1604
,
1600
,
1606
,
1586
,
1610
,
1403
,
1584
,
/* 540 */
1
587
,
1608
,
1478
,
1626
,
1625
,
1627
,
1592
,
1631
,
1424
,
1593
,
/* 550 */
16
43
,
1646
,
1647
,
1648
,
1649
,
1651
,
1593
,
1677
,
1499
,
1650
,
/* 560 */
1609
,
16
11
,
1613
,
1615
,
1614
,
1616
,
1655
,
1621
,
1622
,
1656
,
/* 570 */
16
67
,
1533
,
1624
,
1597
,
1628
,
1673
,
1674
,
1632
,
1630
,
1675
,
/* 580 */
16
33
,
1639
,
1690
,
1645
,
1652
,
1691
,
1660
,
1661
,
1693
,
1663
,
/* 590 */
16
40
,
1641
,
1653
,
1654
,
1708
,
1637
,
1668
,
1669
,
1698
,
1670
,
/* 600 */
17
10
,
1710
,
1712
,
1689
,
1695
,
1720
,
1696
,
1676
,
1715
,
1728
,
/* 610 */
172
9
,
1731
,
1732
,
1733
,
1747
,
1736
,
1738
,
1709
,
1513
,
1740
,
/* 620 */
15
14
,
1742
,
1743
,
1744
,
1745
,
1748
,
1750
,
1782
,
1751
,
1741
,
/* 630 */
175
3
,
1787
,
1755
,
1746
,
1756
,
1794
,
1761
,
1752
,
1759
,
1800
,
/* 640 */
177
2
,
1762
,
1771
,
1811
,
1777
,
1778
,
1814
,
1793
,
1797
,
1804
,
/* 650 */
180
6
,
1798
,
1810
,
};
#define YY_REDUCE_COUNT (269)
#define YY_REDUCE_MIN (-3
2
9)
#define YY_REDUCE_MAX (2
136
)
#define YY_REDUCE_MIN (-3
4
9)
#define YY_REDUCE_MAX (2
274
)
static
const
short
yy_reduce_ofst
[]
=
{
/* 0 */
-
246
,
688
,
769
,
-
197
,
789
,
881
,
944
,
971
,
1042
,
1107
,
/* 10 */
11
78
,
1200
,
1263
,
348
,
1281
,
1334
,
1388
,
1399
,
1456
,
1477
,
/* 20 */
1
519
,
1542
,
1599
,
1610
,
1624
,
1666
,
1680
,
1691
,
1733
,
1775
,
/* 30 */
1
786
,
1798
,
1853
,
1880
,
1907
,
1934
,
1988
,
1997
,
2015
,
2068
,
/* 40 */
2
082
,
2136
,
288
,
490
,
-
236
,
-
122
,
-
20
,
-
280
,
-
262
,
-
260
,
/* 50 */
-
55
,
-
285
,
-
80
,
-
41
,
206
,
289
,
-
259
,
-
252
,
-
329
,
-
279
,
/* 60 */
-
126
,
-
49
,
268
,
341
,
342
,
351
,
459
,
460
,
461
,
517
,
/* 70 */
-
25
0
,
520
,
543
,
559
,
-
251
,
-
181
,
-
104
,
642
,
645
,
270
,
/* 80 */
709
,
292
,
330
,
299
,
711
,
332
,
-
234
,
-
190
,
-
190
,
-
190
,
/* 90 */
-
99
,
146
,
120
,
244
,
354
,
356
,
385
,
444
,
532
,
549
,
/* 100 */
5
69
,
576
,
621
,
651
,
657
,
682
,
691
,
694
,
695
,
72
5
,
/* 110 */
742
,
20
,
229
,
-
101
,
407
,
11
,
264
,
464
,
467
,
500
,
/* 120 */
80
,
456
,
83
,
7
,
-
307
,
-
97
,
189
,
325
,
149
,
436
,
/* 130 */
4
42
,
640
,
-
273
,
266
,
297
,
443
,
452
,
472
,
509
,
259
,
/* 140 */
5
63
,
554
,
469
,
494
,
609
,
595
,
622
,
715
,
715
,
77
3
,
/* 150 */
7
64
,
745
,
733
,
712
,
712
,
712
,
718
,
702
,
704
,
714
,
/* 160 */
72
9
,
715
,
768
,
842
,
794
,
856
,
814
,
882
,
883
,
845
,
/* 170 */
8
49
,
850
,
890
,
898
,
899
,
840
,
893
,
860
,
894
,
851
,
/* 180 */
8
52
,
901
,
858
,
904
,
870
,
908
,
909
,
915
,
918
,
925
,
/* 190 */
903
,
905
,
906
,
907
,
910
,
911
,
912
,
913
,
914
,
917
,
/* 200 */
91
9
,
924
,
934
,
896
,
879
,
936
,
886
,
916
,
941
,
953
,
/* 210 */
9
54
,
895
,
955
,
902
,
933
,
866
,
927
,
935
,
873
,
931
,
/* 220 */
9
43
,
945
,
715
,
885
,
887
,
892
,
897
,
920
,
923
,
928
,
/* 230 */
712
,
965
,
938
,
922
,
939
,
930
,
937
,
942
,
940
,
947
,
/* 240 */
9
48
,
958
,
986
,
987
,
988
,
994
,
996
,
963
,
997
,
989
,
/* 250 */
1029
,
1014
,
1052
,
1037
,
1054
,
1030
,
1039
,
1034
,
1056
,
1061
,
/* 260 */
10
62
,
1074
,
1077
,
1035
,
1024
,
1064
,
1065
,
1066
,
1070
,
1084
,
/* 0 */
-
246
,
-
200
,
689
,
767
,
828
,
845
,
898
,
953
,
1031
,
1043
,
/* 10 */
11
12
,
1169
,
1190
,
1250
,
1306
,
1328
,
1389
,
1017
,
1409
,
1474
,
/* 20 */
1
493
,
1562
,
1578
,
1620
,
1644
,
1686
,
1706
,
1766
,
1790
,
1846
,
/* 30 */
1
870
,
1912
,
1928
,
1970
,
1990
,
2050
,
2074
,
2130
,
2154
,
2196
,
/* 40 */
2
212
,
2254
,
2274
,
-
245
,
490
,
-
191
,
-
120
,
-
20
,
-
271
,
-
249
,
/* 50 */
-
235
,
-
218
,
222
,
258
,
41
,
44
,
-
259
,
-
254
,
-
349
,
-
240
,
/* 60 */
-
277
,
-
256
,
46
,
103
,
206
,
288
,
298
,
300
,
319
,
342
,
/* 70 */
-
25
7
,
351
,
355
,
391
,
-
64
,
-
101
,
405
,
517
,
-
11
,
-
267
,
/* 80 */
526
,
248
,
360
,
267
,
557
,
216
,
-
252
,
-
171
,
-
171
,
-
171
,
/* 90 */
-
176
,
-
253
,
47
,
85
,
120
,
379
,
389
,
403
,
425
,
481
,
/* 100 */
5
32
,
539
,
549
,
577
,
579
,
604
,
607
,
617
,
651
,
67
5
,
/* 110 */
678
,
-
133
,
87
,
-
46
,
45
,
-
258
,
203
,
295
,
93
,
327
,
/* 120 */
402
,
296
,
376
,
501
,
305
,
362
,
550
,
297
,
78
,
436
,
/* 130 */
4
58
,
479
,
-
283
,
193
,
253
,
514
,
573
,
592
,
661
,
236
,
/* 140 */
5
30
,
668
,
576
,
485
,
727
,
662
,
650
,
742
,
742
,
76
3
,
/* 150 */
7
98
,
766
,
740
,
716
,
716
,
716
,
724
,
704
,
707
,
713
,
/* 160 */
72
8
,
742
,
768
,
825
,
773
,
836
,
793
,
850
,
851
,
813
,
/* 170 */
8
16
,
819
,
858
,
868
,
870
,
814
,
864
,
837
,
866
,
826
,
/* 180 */
8
27
,
872
,
831
,
877
,
843
,
879
,
881
,
886
,
883
,
897
,
/* 190 */
869
,
878
,
884
,
900
,
901
,
902
,
907
,
909
,
910
,
912
,
/* 200 */
91
5
,
917
,
921
,
905
,
846
,
937
,
887
,
908
,
938
,
942
,
/* 210 */
9
44
,
904
,
946
,
859
,
916
,
918
,
922
,
923
,
924
,
927
,
/* 220 */
9
11
,
926
,
929
,
959
,
958
,
969
,
947
,
919
,
950
,
889
,
/* 230 */
948
,
961
,
963
,
894
,
951
,
964
,
965
,
742
,
892
,
913
,
/* 240 */
9
14
,
930
,
935
,
933
,
954
,
716
,
976
,
952
,
928
,
925
,
/* 250 */
936
,
934
,
939
,
940
,
943
,
977
,
1012
,
1005
,
1033
,
1039
,
/* 260 */
10
47
,
1058
,
1061
,
1004
,
1010
,
1048
,
1051
,
1053
,
1055
,
1070
,
};
static
const
YYACTIONTYPE
yy_default
[]
=
{
/* 0 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
...
...
@@ -832,8 +858,8 @@ static const YYACTIONTYPE yy_default[] = {
/* 80 */
1437
,
1437
,
1437
,
1437
,
1437
,
1507
,
1660
,
1437
,
1836
,
1437
,
/* 90 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 100 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 110 */
1437
,
1437
,
1437
,
1437
,
1437
,
1509
,
1437
,
1
848
,
1848
,
1848
,
/* 120 */
1
507
,
1437
,
1437
,
1437
,
1704
,
1704
,
1437
,
1437
,
1437
,
1437
,
/* 110 */
1437
,
1437
,
1437
,
1437
,
1437
,
1509
,
1437
,
1
507
,
1848
,
1848
,
/* 120 */
1
848
,
1437
,
1437
,
1437
,
1704
,
1704
,
1437
,
1437
,
1437
,
1437
,
/* 130 */
1603
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1696
,
/* 140 */
1437
,
1437
,
1917
,
1437
,
1437
,
1702
,
1871
,
1437
,
1437
,
1437
,
/* 150 */
1437
,
1556
,
1863
,
1840
,
1854
,
1841
,
1838
,
1902
,
1902
,
1902
,
...
...
@@ -842,19 +868,19 @@ static const YYACTIONTYPE yy_default[] = {
/* 180 */
1437
,
1509
,
1437
,
1509
,
1437
,
1509
,
1509
,
1437
,
1509
,
1437
,
/* 190 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 200 */
1437
,
1437
,
1437
,
1437
,
1437
,
1507
,
1698
,
1437
,
1507
,
1437
,
/* 210 */
1437
,
1437
,
1507
,
1
437
,
1437
,
1878
,
1876
,
1437
,
1878
,
1876
,
/* 220 */
1437
,
1437
,
1437
,
1
890
,
1886
,
1878
,
1894
,
1892
,
1869
,
1867
,
/* 230 */
18
54
,
1437
,
1437
,
1908
,
1904
,
1920
,
1908
,
1904
,
1908
,
1904
,
/* 240 */
1
437
,
1876
,
1437
,
1437
,
1437
,
1437
,
1437
,
1876
,
1437
,
1437
,
/* 250 */
1
437
,
1437
,
1507
,
1437
,
1507
,
1437
,
1572
,
1437
,
1437
,
1437
,
/* 210 */
1437
,
1437
,
1507
,
1
876
,
1437
,
1437
,
1437
,
1437
,
1876
,
1437
,
/* 220 */
1437
,
1437
,
1437
,
1
507
,
1437
,
1507
,
1437
,
1437
,
1437
,
1878
,
/* 230 */
18
76
,
1437
,
1437
,
1878
,
1876
,
1437
,
1437
,
1437
,
1890
,
1886
,
/* 240 */
1
878
,
1894
,
1892
,
1869
,
1867
,
1854
,
1437
,
1437
,
1908
,
1904
,
/* 250 */
1
920
,
1908
,
1904
,
1908
,
1904
,
1437
,
1572
,
1437
,
1437
,
1437
,
/* 260 */
1507
,
1469
,
1437
,
1690
,
1704
,
1606
,
1606
,
1606
,
1510
,
1442
,
/* 270 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 280 */
1437
,
1
774
,
1889
,
1888
,
1812
,
1811
,
1810
,
1808
,
1773
,
1437
,
/* 280 */
1437
,
1
437
,
1774
,
1889
,
1888
,
1812
,
1811
,
1810
,
1808
,
1773
,
/* 290 */
1437
,
1568
,
1772
,
1771
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 300 */
1437
,
1
765
,
1766
,
1764
,
1763
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 310 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1
8
37
,
/* 320 */
1437
,
1
905
,
1909
,
1437
,
1437
,
1437
,
1748
,
1437
,
1437
,
1437
,
/* 330 */
1437
,
1437
,
1437
,
1
437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 300 */
1437
,
1
437
,
1765
,
1766
,
1764
,
1763
,
1437
,
1437
,
1437
,
1437
,
/* 310 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1
4
37
,
/* 320 */
1437
,
1
437
,
1437
,
1437
,
1437
,
1437
,
1837
,
1437
,
1905
,
1909
,
/* 330 */
1437
,
1437
,
1437
,
1
748
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 340 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 350 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 360 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
...
...
@@ -871,14 +897,14 @@ static const YYACTIONTYPE yy_default[] = {
/* 470 */
1537
,
1536
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 480 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 490 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 500 */
1437
,
1437
,
1437
,
1437
,
1437
,
1
870
,
1437
,
1437
,
1437
,
1437
,
/* 510 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1
437
,
1748
,
/* 520 */
1437
,
1
887
,
1437
,
1847
,
1843
,
1437
,
1437
,
1839
,
1437
,
1437
,
/* 530 */
1
903
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
143
7
,
/* 540 */
18
32
,
1437
,
1805
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 550 */
1437
,
1
759
,
1437
,
1437
,
1437
,
1437
,
1437
,
1708
,
1437
,
1437
,
/* 560 */
1
437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1747
,
1437
,
1790
,
1437
,
/* 570 */
1437
,
1
437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1600
,
1437
,
1437
,
/* 500 */
1437
,
1437
,
1437
,
1437
,
1437
,
1
437
,
1437
,
1437
,
1708
,
1437
,
/* 510 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1
870
,
1437
,
/* 520 */
1437
,
1
437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 530 */
1
437
,
1437
,
1437
,
1437
,
1437
,
1748
,
1437
,
1887
,
1437
,
184
7
,
/* 540 */
18
43
,
1437
,
1437
,
1839
,
1747
,
1437
,
1437
,
1903
,
1437
,
1437
,
/* 550 */
1437
,
1
437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1832
,
1437
,
1805
,
/* 560 */
1
790
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 570 */
1437
,
1
759
,
1437
,
1437
,
1437
,
1437
,
1437
,
1600
,
1437
,
1437
,
/* 580 */
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
/* 590 */
1585
,
1583
,
1582
,
1581
,
1437
,
1578
,
1437
,
1437
,
1437
,
1437
,
/* 600 */
1609
,
1608
,
1437
,
1437
,
1437
,
1437
,
1437
,
1437
,
1529
,
1437
,
...
...
@@ -1533,7 +1559,7 @@ static const char *const yyTokenName[] = {
/* 285 */
"signed_literal"
,
/* 286 */
"create_subtable_clause"
,
/* 287 */
"specific_tags_opt"
,
/* 288 */
"
literal
_list"
,
/* 288 */
"
expression
_list"
,
/* 289 */
"drop_table_clause"
,
/* 290 */
"col_name_list"
,
/* 291 */
"table_name"
,
...
...
@@ -1555,21 +1581,21 @@ static const char *const yyTokenName[] = {
/* 307 */
"sliding_opt"
,
/* 308 */
"sma_stream_opt"
,
/* 309 */
"func"
,
/* 310 */
"
expression_list
"
,
/* 311 */
"
stream_options
"
,
/* 312 */
"
topic_name
"
,
/* 313 */
"
query_expression
"
,
/* 314 */
"
cgroup_name
"
,
/* 315 */
"
analyze_opt
"
,
/* 316 */
"
explain_options
"
,
/* 317 */
"
agg_func
_opt"
,
/* 318 */
"
bufsize_opt
"
,
/* 319 */
"
stream_name
"
,
/* 320 */
"
into_op
t"
,
/* 321 */
"
dnode_lis
t"
,
/* 322 */
"
where_clause_opt
"
,
/* 323 */
"
signed
"
,
/* 324 */
"literal_
func
"
,
/* 310 */
"
stream_options
"
,
/* 311 */
"
topic_name
"
,
/* 312 */
"
query_expression
"
,
/* 313 */
"
cgroup_name
"
,
/* 314 */
"
analyze_opt
"
,
/* 315 */
"
explain_options
"
,
/* 316 */
"
agg_func_opt
"
,
/* 317 */
"
bufsize
_opt"
,
/* 318 */
"
stream_name
"
,
/* 319 */
"
into_opt
"
,
/* 320 */
"
dnode_lis
t"
,
/* 321 */
"
where_clause_op
t"
,
/* 322 */
"
signed
"
,
/* 323 */
"
literal_func
"
,
/* 324 */
"literal_
list
"
,
/* 325 */
"table_alias"
,
/* 326 */
"column_alias"
,
/* 327 */
"expression"
,
...
...
@@ -1755,7 +1781,7 @@ static const char *const yyRuleName[] = {
/* 125 */
"alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal"
,
/* 126 */
"multi_create_clause ::= create_subtable_clause"
,
/* 127 */
"multi_create_clause ::= multi_create_clause create_subtable_clause"
,
/* 128 */
"create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP
literal
_list NK_RP table_options"
,
/* 128 */
"create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP
expression
_list NK_RP table_options"
,
/* 129 */
"multi_drop_clause ::= drop_table_clause"
,
/* 130 */
"multi_drop_clause ::= multi_drop_clause drop_table_clause"
,
/* 131 */
"drop_table_clause ::= exists_opt full_table_name"
,
...
...
@@ -2260,13 +2286,13 @@ static void yy_destructor(
case
307
:
/* sliding_opt */
case
308
:
/* sma_stream_opt */
case
309
:
/* func */
case
31
1
:
/* stream_options */
case
31
3
:
/* query_expression */
case
31
6
:
/* explain_options */
case
3
20
:
/* into_opt */
case
32
2
:
/* where_clause_opt */
case
32
3
:
/* signed */
case
32
4
:
/* literal_func */
case
31
0
:
/* stream_options */
case
31
2
:
/* query_expression */
case
31
5
:
/* explain_options */
case
3
19
:
/* into_opt */
case
32
1
:
/* where_clause_opt */
case
32
2
:
/* signed */
case
32
3
:
/* literal_func */
case
327
:
/* expression */
case
328
:
/* pseudo_column */
case
329
:
/* column_reference */
...
...
@@ -2304,7 +2330,7 @@ static void yy_destructor(
case
253
:
/* account_options */
case
254
:
/* alter_account_options */
case
256
:
/* alter_account_option */
case
31
8
:
/* bufsize_opt */
case
31
7
:
/* bufsize_opt */
{
}
...
...
@@ -2317,9 +2343,9 @@ static void yy_destructor(
case
291
:
/* table_name */
case
298
:
/* function_name */
case
304
:
/* index_name */
case
31
2
:
/* topic_name */
case
31
4
:
/* cgroup_name */
case
31
9
:
/* stream_name */
case
31
1
:
/* topic_name */
case
31
3
:
/* cgroup_name */
case
31
8
:
/* stream_name */
case
325
:
/* table_alias */
case
326
:
/* column_alias */
case
332
:
/* star_func */
...
...
@@ -2343,8 +2369,8 @@ static void yy_destructor(
break
;
case
265
:
/* not_exists_opt */
case
267
:
/* exists_opt */
case
31
5
:
/* analyze_opt */
case
31
7
:
/* agg_func_opt */
case
31
4
:
/* analyze_opt */
case
31
6
:
/* agg_func_opt */
case
354
:
/* set_quantifier_opt */
{
...
...
@@ -2359,13 +2385,13 @@ static void yy_destructor(
case
279
:
/* tags_def */
case
280
:
/* multi_drop_clause */
case
287
:
/* specific_tags_opt */
case
288
:
/*
literal
_list */
case
288
:
/*
expression
_list */
case
290
:
/* col_name_list */
case
293
:
/* duration_list */
case
294
:
/* rollup_func_list */
case
306
:
/* func_list */
case
3
10
:
/* expression
_list */
case
32
1
:
/* dnode
_list */
case
3
20
:
/* dnode
_list */
case
32
4
:
/* literal
_list */
case
333
:
/* star_func_para_list */
case
335
:
/* other_para_list */
case
355
:
/* select_list */
...
...
@@ -2837,7 +2863,7 @@ static const struct {
{
281
,
-
6
},
/* (125) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
{
278
,
-
1
},
/* (126) multi_create_clause ::= create_subtable_clause */
{
278
,
-
2
},
/* (127) multi_create_clause ::= multi_create_clause create_subtable_clause */
{
286
,
-
10
},
/* (128) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP
literal
_list NK_RP table_options */
{
286
,
-
10
},
/* (128) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP
expression
_list NK_RP table_options */
{
280
,
-
1
},
/* (129) multi_drop_clause ::= drop_table_clause */
{
280
,
-
2
},
/* (130) multi_drop_clause ::= multi_drop_clause drop_table_clause */
{
289
,
-
2
},
/* (131) drop_table_clause ::= exists_opt full_table_name */
...
...
@@ -2957,28 +2983,28 @@ static const struct {
{
252
,
-
2
},
/* (245) cmd ::= DESCRIBE full_table_name */
{
252
,
-
3
},
/* (246) cmd ::= RESET QUERY CACHE */
{
252
,
-
4
},
/* (247) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
{
31
5
,
0
},
/* (248) analyze_opt ::= */
{
31
5
,
-
1
},
/* (249) analyze_opt ::= ANALYZE */
{
31
6
,
0
},
/* (250) explain_options ::= */
{
31
6
,
-
3
},
/* (251) explain_options ::= explain_options VERBOSE NK_BOOL */
{
31
6
,
-
3
},
/* (252) explain_options ::= explain_options RATIO NK_FLOAT */
{
31
4
,
0
},
/* (248) analyze_opt ::= */
{
31
4
,
-
1
},
/* (249) analyze_opt ::= ANALYZE */
{
31
5
,
0
},
/* (250) explain_options ::= */
{
31
5
,
-
3
},
/* (251) explain_options ::= explain_options VERBOSE NK_BOOL */
{
31
5
,
-
3
},
/* (252) explain_options ::= explain_options RATIO NK_FLOAT */
{
252
,
-
6
},
/* (253) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
{
252
,
-
10
},
/* (254) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
{
252
,
-
4
},
/* (255) cmd ::= DROP FUNCTION exists_opt function_name */
{
31
7
,
0
},
/* (256) agg_func_opt ::= */
{
31
7
,
-
1
},
/* (257) agg_func_opt ::= AGGREGATE */
{
31
8
,
0
},
/* (258) bufsize_opt ::= */
{
31
8
,
-
2
},
/* (259) bufsize_opt ::= BUFSIZE NK_INTEGER */
{
31
6
,
0
},
/* (256) agg_func_opt ::= */
{
31
6
,
-
1
},
/* (257) agg_func_opt ::= AGGREGATE */
{
31
7
,
0
},
/* (258) bufsize_opt ::= */
{
31
7
,
-
2
},
/* (259) bufsize_opt ::= BUFSIZE NK_INTEGER */
{
252
,
-
8
},
/* (260) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
{
252
,
-
4
},
/* (261) cmd ::= DROP STREAM exists_opt stream_name */
{
3
20
,
0
},
/* (262) into_opt ::= */
{
3
20
,
-
2
},
/* (263) into_opt ::= INTO full_table_name */
{
31
1
,
0
},
/* (264) stream_options ::= */
{
31
1
,
-
3
},
/* (265) stream_options ::= stream_options TRIGGER AT_ONCE */
{
31
1
,
-
3
},
/* (266) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
{
31
1
,
-
4
},
/* (267) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
{
31
1
,
-
3
},
/* (268) stream_options ::= stream_options WATERMARK duration_literal */
{
31
1
,
-
3
},
/* (269) stream_options ::= stream_options IGNORE EXPIRED */
{
3
19
,
0
},
/* (262) into_opt ::= */
{
3
19
,
-
2
},
/* (263) into_opt ::= INTO full_table_name */
{
31
0
,
0
},
/* (264) stream_options ::= */
{
31
0
,
-
3
},
/* (265) stream_options ::= stream_options TRIGGER AT_ONCE */
{
31
0
,
-
3
},
/* (266) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
{
31
0
,
-
4
},
/* (267) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
{
31
0
,
-
3
},
/* (268) stream_options ::= stream_options WATERMARK duration_literal */
{
31
0
,
-
3
},
/* (269) stream_options ::= stream_options IGNORE EXPIRED */
{
252
,
-
3
},
/* (270) cmd ::= KILL CONNECTION NK_INTEGER */
{
252
,
-
3
},
/* (271) cmd ::= KILL QUERY NK_STRING */
{
252
,
-
3
},
/* (272) cmd ::= KILL TRANSACTION NK_INTEGER */
...
...
@@ -2986,8 +3012,8 @@ static const struct {
{
252
,
-
4
},
/* (274) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
{
252
,
-
4
},
/* (275) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
{
252
,
-
3
},
/* (276) cmd ::= SPLIT VGROUP NK_INTEGER */
{
32
1
,
-
2
},
/* (277) dnode_list ::= DNODE NK_INTEGER */
{
32
1
,
-
3
},
/* (278) dnode_list ::= dnode_list DNODE NK_INTEGER */
{
32
0
,
-
2
},
/* (277) dnode_list ::= DNODE NK_INTEGER */
{
32
0
,
-
3
},
/* (278) dnode_list ::= dnode_list DNODE NK_INTEGER */
{
252
,
-
3
},
/* (279) cmd ::= SYNCDB db_name REPLICA */
{
252
,
-
4
},
/* (280) cmd ::= DELETE FROM full_table_name where_clause_opt */
{
252
,
-
1
},
/* (281) cmd ::= query_expression */
...
...
@@ -3000,12 +3026,12 @@ static const struct {
{
255
,
-
1
},
/* (288) literal ::= NULL */
{
255
,
-
1
},
/* (289) literal ::= NK_QUESTION */
{
296
,
-
1
},
/* (290) duration_literal ::= NK_VARIABLE */
{
32
3
,
-
1
},
/* (291) signed ::= NK_INTEGER */
{
32
3
,
-
2
},
/* (292) signed ::= NK_PLUS NK_INTEGER */
{
32
3
,
-
2
},
/* (293) signed ::= NK_MINUS NK_INTEGER */
{
32
3
,
-
1
},
/* (294) signed ::= NK_FLOAT */
{
32
3
,
-
2
},
/* (295) signed ::= NK_PLUS NK_FLOAT */
{
32
3
,
-
2
},
/* (296) signed ::= NK_MINUS NK_FLOAT */
{
32
2
,
-
1
},
/* (291) signed ::= NK_INTEGER */
{
32
2
,
-
2
},
/* (292) signed ::= NK_PLUS NK_INTEGER */
{
32
2
,
-
2
},
/* (293) signed ::= NK_MINUS NK_INTEGER */
{
32
2
,
-
1
},
/* (294) signed ::= NK_FLOAT */
{
32
2
,
-
2
},
/* (295) signed ::= NK_PLUS NK_FLOAT */
{
32
2
,
-
2
},
/* (296) signed ::= NK_MINUS NK_FLOAT */
{
285
,
-
1
},
/* (297) signed_literal ::= signed */
{
285
,
-
1
},
/* (298) signed_literal ::= NK_STRING */
{
285
,
-
1
},
/* (299) signed_literal ::= NK_BOOL */
...
...
@@ -3013,8 +3039,8 @@ static const struct {
{
285
,
-
1
},
/* (301) signed_literal ::= duration_literal */
{
285
,
-
1
},
/* (302) signed_literal ::= NULL */
{
285
,
-
1
},
/* (303) signed_literal ::= literal_func */
{
288
,
-
1
},
/* (304) literal_list ::= signed_literal */
{
288
,
-
3
},
/* (305) literal_list ::= literal_list NK_COMMA signed_literal */
{
324
,
-
1
},
/* (304) literal_list ::= signed_literal */
{
324
,
-
3
},
/* (305) literal_list ::= literal_list NK_COMMA signed_literal */
{
263
,
-
1
},
/* (306) db_name ::= NK_ID */
{
291
,
-
1
},
/* (307) table_name ::= NK_ID */
{
283
,
-
1
},
/* (308) column_name ::= NK_ID */
...
...
@@ -3023,9 +3049,9 @@ static const struct {
{
326
,
-
1
},
/* (311) column_alias ::= NK_ID */
{
257
,
-
1
},
/* (312) user_name ::= NK_ID */
{
304
,
-
1
},
/* (313) index_name ::= NK_ID */
{
31
2
,
-
1
},
/* (314) topic_name ::= NK_ID */
{
31
9
,
-
1
},
/* (315) stream_name ::= NK_ID */
{
31
4
,
-
1
},
/* (316) cgroup_name ::= NK_ID */
{
31
1
,
-
1
},
/* (314) topic_name ::= NK_ID */
{
31
8
,
-
1
},
/* (315) stream_name ::= NK_ID */
{
31
3
,
-
1
},
/* (316) cgroup_name ::= NK_ID */
{
327
,
-
1
},
/* (317) expression ::= literal */
{
327
,
-
1
},
/* (318) expression ::= pseudo_column */
{
327
,
-
1
},
/* (319) expression ::= column_reference */
...
...
@@ -3042,8 +3068,8 @@ static const struct {
{
327
,
-
3
},
/* (330) expression ::= column_reference NK_ARROW NK_STRING */
{
327
,
-
3
},
/* (331) expression ::= expression NK_BITAND expression */
{
327
,
-
3
},
/* (332) expression ::= expression NK_BITOR expression */
{
310
,
-
1
},
/* (333) expression_list ::= expression */
{
310
,
-
3
},
/* (334) expression_list ::= expression_list NK_COMMA expression */
{
288
,
-
1
},
/* (333) expression_list ::= expression */
{
288
,
-
3
},
/* (334) expression_list ::= expression_list NK_COMMA expression */
{
329
,
-
1
},
/* (335) column_reference ::= column_name */
{
329
,
-
3
},
/* (336) column_reference ::= table_name NK_DOT column_name */
{
328
,
-
1
},
/* (337) pseudo_column ::= ROWTS */
...
...
@@ -3058,8 +3084,8 @@ static const struct {
{
330
,
-
4
},
/* (346) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
{
330
,
-
6
},
/* (347) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
{
330
,
-
1
},
/* (348) function_expression ::= literal_func */
{
32
4
,
-
3
},
/* (349) literal_func ::= noarg_func NK_LP NK_RP */
{
32
4
,
-
1
},
/* (350) literal_func ::= NOW */
{
32
3
,
-
3
},
/* (349) literal_func ::= noarg_func NK_LP NK_RP */
{
32
3
,
-
1
},
/* (350) literal_func ::= NOW */
{
334
,
-
1
},
/* (351) noarg_func ::= NOW */
{
334
,
-
1
},
/* (352) noarg_func ::= TODAY */
{
334
,
-
1
},
/* (353) noarg_func ::= TIMEZONE */
...
...
@@ -3136,8 +3162,8 @@ static const struct {
{
363
,
-
2
},
/* (424) select_item ::= common_expression column_alias */
{
363
,
-
3
},
/* (425) select_item ::= common_expression AS column_alias */
{
363
,
-
3
},
/* (426) select_item ::= table_name NK_DOT NK_STAR */
{
32
2
,
0
},
/* (427) where_clause_opt ::= */
{
32
2
,
-
2
},
/* (428) where_clause_opt ::= WHERE search_condition */
{
32
1
,
0
},
/* (427) where_clause_opt ::= */
{
32
1
,
-
2
},
/* (428) where_clause_opt ::= WHERE search_condition */
{
356
,
0
},
/* (429) partition_by_clause_opt ::= */
{
356
,
-
3
},
/* (430) partition_by_clause_opt ::= PARTITION BY expression_list */
{
360
,
0
},
/* (431) twindow_clause_opt ::= */
...
...
@@ -3165,7 +3191,7 @@ static const struct {
{
357
,
-
6
},
/* (453) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */
{
358
,
0
},
/* (454) every_opt ::= */
{
358
,
-
4
},
/* (455) every_opt ::= EVERY NK_LP duration_literal NK_RP */
{
31
3
,
-
4
},
/* (456) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
31
2
,
-
4
},
/* (456) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
366
,
-
1
},
/* (457) query_expression_body ::= query_primary */
{
366
,
-
4
},
/* (458) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{
366
,
-
3
},
/* (459) query_expression_body ::= query_expression_body UNION query_expression_body */
...
...
@@ -3660,10 +3686,12 @@ static YYACTIONTYPE yy_reduce(
{
pCxt
->
pRootNode
=
createDropSuperTableStmt
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy737
,
yymsp
[
0
].
minor
.
yy212
);
}
break
;
case
114
:
/* cmd ::= ALTER TABLE alter_table_clause */
case
115
:
/* cmd ::= ALTER STABLE alter_table_clause */
yytestcase
(
yyruleno
==
115
);
case
281
:
/* cmd ::= query_expression */
yytestcase
(
yyruleno
==
281
);
{
pCxt
->
pRootNode
=
yymsp
[
0
].
minor
.
yy212
;
}
break
;
case
115
:
/* cmd ::= ALTER STABLE alter_table_clause */
{
pCxt
->
pRootNode
=
setAlterSuperTableType
(
yymsp
[
0
].
minor
.
yy212
);
}
break
;
case
116
:
/* alter_table_clause ::= full_table_name alter_table_options */
{
yylhsminor
.
yy212
=
createAlterTableModifyOptions
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy212
,
yymsp
[
0
].
minor
.
yy212
);
}
yymsp
[
-
1
].
minor
.
yy212
=
yylhsminor
.
yy212
;
...
...
@@ -3709,7 +3737,7 @@ static YYACTIONTYPE yy_reduce(
{
yylhsminor
.
yy424
=
addNodeToList
(
pCxt
,
yymsp
[
-
1
].
minor
.
yy424
,
yymsp
[
0
].
minor
.
yy212
);
}
yymsp
[
-
1
].
minor
.
yy424
=
yylhsminor
.
yy424
;
break
;
case
128
:
/* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP
literal
_list NK_RP table_options */
case
128
:
/* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP
expression
_list NK_RP table_options */
{
yylhsminor
.
yy212
=
createCreateSubTableClause
(
pCxt
,
yymsp
[
-
9
].
minor
.
yy737
,
yymsp
[
-
8
].
minor
.
yy212
,
yymsp
[
-
6
].
minor
.
yy212
,
yymsp
[
-
5
].
minor
.
yy424
,
yymsp
[
-
2
].
minor
.
yy424
,
yymsp
[
0
].
minor
.
yy212
);
}
yymsp
[
-
9
].
minor
.
yy212
=
yylhsminor
.
yy212
;
break
;
...
...
source/libs/parser/test/parInitialATest.cpp
浏览文件 @
ba72ce2b
...
...
@@ -77,8 +77,6 @@ TEST_F(ParserInitialATest, alterLocal) {
clearAlterLocal
();
}
// todo ALTER stable
/*
* ALTER TABLE [db_name.]tb_name alter_table_clause
*
...
...
@@ -157,7 +155,7 @@ TEST_F(ParserInitialATest, alterSTable) {
};
setCheckDdlFunc
([
&
](
const
SQuery
*
pQuery
,
ParserStage
stage
)
{
ASSERT_EQ
(
nodeType
(
pQuery
->
pRoot
),
QUERY_NODE_ALTER_TABLE_STMT
);
ASSERT_EQ
(
nodeType
(
pQuery
->
pRoot
),
QUERY_NODE_ALTER_
SUPER_
TABLE_STMT
);
SMAlterStbReq
req
=
{
0
};
ASSERT_EQ
(
tDeserializeSMAlterStbReq
(
pQuery
->
pCmdMsg
->
pMsg
,
pQuery
->
pCmdMsg
->
msgLen
,
&
req
),
TSDB_CODE_SUCCESS
);
ASSERT_EQ
(
std
::
string
(
req
.
name
),
std
::
string
(
expect
.
name
));
...
...
@@ -181,44 +179,44 @@ TEST_F(ParserInitialATest, alterSTable) {
});
// setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_OPTIONS, 0, nullptr, 0, 0, nullptr, nullptr, 10);
// run("ALTER TABLE st1 TTL 10");
// run("ALTER
S
TABLE st1 TTL 10");
// clearAlterStbReq();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_UPDATE_OPTIONS
,
0
,
nullptr
,
0
,
0
,
nullptr
,
"test"
);
run
(
"ALTER TABLE st1 COMMENT 'test'"
);
run
(
"ALTER
S
TABLE st1 COMMENT 'test'"
);
clearAlterStbReq
();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
1
,
"cc1"
,
TSDB_DATA_TYPE_BIGINT
);
run
(
"ALTER TABLE st1 ADD COLUMN cc1 BIGINT"
);
run
(
"ALTER
S
TABLE st1 ADD COLUMN cc1 BIGINT"
);
clearAlterStbReq
();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_DROP_COLUMN
,
1
,
"c1"
);
run
(
"ALTER TABLE st1 DROP COLUMN c1"
);
run
(
"ALTER
S
TABLE st1 DROP COLUMN c1"
);
clearAlterStbReq
();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES
,
1
,
"c2"
,
TSDB_DATA_TYPE_VARCHAR
,
30
+
VARSTR_HEADER_SIZE
);
run
(
"ALTER TABLE st1 MODIFY COLUMN c2 VARCHAR(30)"
);
run
(
"ALTER
S
TABLE st1 MODIFY COLUMN c2 VARCHAR(30)"
);
clearAlterStbReq
();
// setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, 2, "c1", 0, 0, "cc1");
// run("ALTER TABLE st1 RENAME COLUMN c1 cc1");
// run("ALTER
S
TABLE st1 RENAME COLUMN c1 cc1");
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_ADD_TAG
,
1
,
"tag11"
,
TSDB_DATA_TYPE_BIGINT
);
run
(
"ALTER TABLE st1 ADD TAG tag11 BIGINT"
);
run
(
"ALTER
S
TABLE st1 ADD TAG tag11 BIGINT"
);
clearAlterStbReq
();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_DROP_TAG
,
1
,
"tag1"
);
run
(
"ALTER TABLE st1 DROP TAG tag1"
);
run
(
"ALTER
S
TABLE st1 DROP TAG tag1"
);
clearAlterStbReq
();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_UPDATE_TAG_BYTES
,
1
,
"tag2"
,
TSDB_DATA_TYPE_VARCHAR
,
30
+
VARSTR_HEADER_SIZE
);
run
(
"ALTER TABLE st1 MODIFY TAG tag2 VARCHAR(30)"
);
run
(
"ALTER
S
TABLE st1 MODIFY TAG tag2 VARCHAR(30)"
);
clearAlterStbReq
();
setAlterStbReqFunc
(
"st1"
,
TSDB_ALTER_TABLE_UPDATE_TAG_NAME
,
2
,
"tag1"
,
0
,
0
,
"tag11"
);
run
(
"ALTER TABLE st1 RENAME TAG tag1 tag11"
);
run
(
"ALTER
S
TABLE st1 RENAME TAG tag1 tag11"
);
clearAlterStbReq
();
// todo
...
...
@@ -228,11 +226,11 @@ TEST_F(ParserInitialATest, alterSTable) {
TEST_F
(
ParserInitialATest
,
alterSTableSemanticCheck
)
{
useDb
(
"root"
,
"test"
);
run
(
"ALTER TABLE st1 RENAME COLUMN c1 cc1"
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
);
run
(
"ALTER
S
TABLE st1 RENAME COLUMN c1 cc1"
,
TSDB_CODE_PAR_INVALID_ALTER_TABLE
);
run
(
"ALTER TABLE st1 MODIFY COLUMN c2 NCHAR(10)"
,
TSDB_CODE_PAR_INVALID_MODIFY_COL
);
run
(
"ALTER
S
TABLE st1 MODIFY COLUMN c2 NCHAR(10)"
,
TSDB_CODE_PAR_INVALID_MODIFY_COL
);
run
(
"ALTER TABLE st1 MODIFY TAG tag2 NCHAR(10)"
,
TSDB_CODE_PAR_INVALID_MODIFY_COL
);
run
(
"ALTER
S
TABLE st1 MODIFY TAG tag2 NCHAR(10)"
,
TSDB_CODE_PAR_INVALID_MODIFY_COL
);
}
TEST_F
(
ParserInitialATest
,
alterTable
)
{
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
ba72ce2b
...
...
@@ -720,7 +720,7 @@ static int32_t pushDownCondOptDealAgg(SOptimizeContext* pCxt, SAggLogicNode* pAg
// TODO: remove it after full implementation of pushing down to child
if
(
1
!=
LIST_LENGTH
(
pAgg
->
node
.
pChildren
)
||
QUERY_NODE_LOGIC_PLAN_SCAN
!=
nodeType
(
nodesListGetNode
(
pAgg
->
node
.
pChildren
,
0
))
&&
QUERY_NODE_LOGIC_PLAN_PROJECT
!=
nodeType
(
nodesListGetNode
(
pAgg
->
node
.
pChildren
,
0
)))
{
QUERY_NODE_LOGIC_PLAN_PROJECT
!=
nodeType
(
nodesListGetNode
(
pAgg
->
node
.
pChildren
,
0
)))
{
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1251,7 +1251,7 @@ static SNode* partTagsCreateWrapperFunc(const char* pFuncName, SNode* pNode) {
}
strcpy
(
pFunc
->
functionName
,
pFuncName
);
if
(
QUERY_NODE_COLUMN
==
nodeType
(
pNode
))
{
if
(
QUERY_NODE_COLUMN
==
nodeType
(
pNode
)
&&
COLUMN_TYPE_TBNAME
!=
((
SColumnNode
*
)
pNode
)
->
colType
)
{
SColumnNode
*
pCol
=
(
SColumnNode
*
)
pNode
;
partTagsSetAlias
(
pFunc
->
node
.
aliasName
,
sizeof
(
pFunc
->
node
.
aliasName
),
pCol
->
tableAlias
,
pCol
->
colName
);
}
else
{
...
...
@@ -1868,6 +1868,8 @@ static EDealRes mergeProjectionsExpr(SNode** pNode, void* pContext) {
pCxt
->
errCode
=
terrno
;
return
DEAL_RES_ERROR
;
}
snprintf
(((
SExprNode
*
)
pExpr
)
->
aliasName
,
sizeof
(((
SExprNode
*
)
pExpr
)
->
aliasName
),
"%s"
,
((
SExprNode
*
)
*
pNode
)
->
aliasName
);
nodesDestroyNode
(
*
pNode
);
*
pNode
=
pExpr
;
}
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
ba72ce2b
...
...
@@ -986,6 +986,10 @@ static bool unionIsChildSubplan(SLogicNode* pLogicNode, int32_t groupId) {
return
((
SExchangeLogicNode
*
)
pLogicNode
)
->
srcGroupId
==
groupId
;
}
if
(
QUERY_NODE_LOGIC_PLAN_MERGE
==
nodeType
(
pLogicNode
))
{
return
((
SMergeLogicNode
*
)
pLogicNode
)
->
srcGroupId
==
groupId
;
}
SNode
*
pChild
;
FOREACH
(
pChild
,
pLogicNode
->
pChildren
)
{
bool
isChild
=
unionIsChildSubplan
((
SLogicNode
*
)
pChild
,
groupId
);
...
...
source/libs/planner/test/planOptimizeTest.cpp
浏览文件 @
ba72ce2b
...
...
@@ -68,6 +68,8 @@ TEST_F(PlanOptimizeTest, PartitionTags) {
run
(
"SELECT SUM(c1), tag1 FROM st1 GROUP BY tag1"
);
run
(
"SELECT SUM(c1), tag1 + 10 FROM st1 GROUP BY tag1 + 10"
);
run
(
"SELECT SUM(c1), tbname FROM st1 GROUP BY tbname"
);
}
TEST_F
(
PlanOptimizeTest
,
eliminateProjection
)
{
...
...
source/libs/planner/test/planSetOpTest.cpp
浏览文件 @
ba72ce2b
...
...
@@ -97,7 +97,15 @@ TEST_F(PlanSetOpTest, unionSubquery) {
run
(
"SELECT * FROM (SELECT c1, c2 FROM t1 UNION SELECT c1, c2 FROM t1)"
);
}
TEST_F
(
PlanSetOpTest
,
bug001
)
{
TEST_F
(
PlanSetOpTest
,
unionWithSubquery
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT c1 FROM (SELECT c1 FROM st1) UNION SELECT c2 FROM (SELECT c1 AS c2 FROM st2)"
);
run
(
"SELECT c1 FROM (SELECT c1 FROM st1 ORDER BY c2) UNION SELECT c1 FROM (SELECT c1 FROM st2)"
);
}
TEST_F
(
PlanSetOpTest
,
unionDataTypeConversion
)
{
useDb
(
"root"
,
"test"
);
run
(
"SELECT c2 FROM t1 WHERE c1 IS NOT NULL GROUP BY c2 "
...
...
source/libs/transport/src/transComm.c
浏览文件 @
ba72ce2b
...
...
@@ -479,6 +479,10 @@ bool transEpSetIsEqual(SEpSet* a, SEpSet* b) {
}
return
true
;
}
static
int32_t
transGetRefMgt
()
{
//
return
refMgt
;
}
static
void
transInitEnv
()
{
refMgt
=
transOpenExHandleMgt
(
50000
);
...
...
@@ -486,8 +490,9 @@ static void transInitEnv() {
}
static
void
transDestroyEnv
()
{
// close ref
transCloseExHandleMgt
(
refMgt
);
transCloseExHandleMgt
();
}
void
transInit
()
{
// init env
taosThreadOnce
(
&
transModuleInit
,
transInitEnv
);
...
...
@@ -502,25 +507,25 @@ int32_t transOpenExHandleMgt(int size) {
}
void
transCloseExHandleMgt
()
{
// close ref
taosCloseRef
(
refMgt
);
taosCloseRef
(
transGetRefMgt
()
);
}
int64_t
transAddExHandle
(
void
*
p
)
{
// acquire extern handle
return
taosAddRef
(
refMgt
,
p
);
return
taosAddRef
(
transGetRefMgt
()
,
p
);
}
int32_t
transRemoveExHandle
(
int64_t
refId
)
{
// acquire extern handle
return
taosRemoveRef
(
refMgt
,
refId
);
return
taosRemoveRef
(
transGetRefMgt
()
,
refId
);
}
SExHandle
*
transAcquireExHandle
(
int64_t
refId
)
{
// acquire extern handle
return
(
SExHandle
*
)
taosAcquireRef
(
refMgt
,
refId
);
return
(
SExHandle
*
)
taosAcquireRef
(
transGetRefMgt
()
,
refId
);
}
int32_t
transReleaseExHandle
(
int64_t
refId
)
{
// release extern handle
return
taosReleaseRef
(
refMgt
,
refId
);
return
taosReleaseRef
(
transGetRefMgt
()
,
refId
);
}
void
transDestoryExHandle
(
void
*
handle
)
{
if
(
handle
==
NULL
)
{
...
...
source/util/src/terror.c
浏览文件 @
ba72ce2b
...
...
@@ -598,6 +598,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TQ_NO_COMMITTED_OFFSET, "No committed offset
TAOS_DEFINE_ERROR
(
TSDB_CODE_INDEX_REBUILDING
,
"Index is rebuilding"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INDEX_REBUILDING
,
"Invalid index file"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_TMQ_INVALID_MSG
,
"Invalid message"
)
...
...
tests/script/tsim/insert/update0.sim
浏览文件 @
ba72ce2b
...
...
@@ -8,8 +8,8 @@ print =============== create database
sql create database d0 keep 365000d,365000d,365000d
sql use d0
print =============== create super table
and register rsma
sql create table if not exists stb (ts timestamp, c1 int) tags (city binary(20),district binary(20))
rollup(min)
;
print =============== create super table
sql create table if not exists stb (ts timestamp, c1 int) tags (city binary(20),district binary(20));
sql show stables
if $rows != 1 then
...
...
tests/system-test/1-insert/block_wise.py
0 → 100644
浏览文件 @
ba72ce2b
import
datetime
import
re
from
dataclasses
import
dataclass
,
field
from
typing
import
List
,
Any
,
Tuple
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
from
util.constant
import
*
PRIMARY_COL
=
"ts"
INT_COL
=
"c_int"
BINT_COL
=
"c_bint"
SINT_COL
=
"c_sint"
TINT_COL
=
"c_tint"
FLOAT_COL
=
"c_float"
DOUBLE_COL
=
"c_double"
BOOL_COL
=
"c_bool"
TINT_UN_COL
=
"c_utint"
SINT_UN_COL
=
"c_usint"
BINT_UN_COL
=
"c_ubint"
INT_UN_COL
=
"c_uint"
BINARY_COL
=
"c_binary"
NCHAR_COL
=
"c_nchar"
TS_COL
=
"c_ts"
NUM_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
]
CHAR_COL
=
[
BINARY_COL
,
NCHAR_COL
,
]
BOOLEAN_COL
=
[
BOOL_COL
,
]
TS_TYPE_COL
=
[
TS_COL
,
]
INT_TAG
=
"t_int"
ALL_COL
=
[
PRIMARY_COL
,
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
BINARY_COL
,
NCHAR_COL
,
BOOL_COL
,
TS_COL
]
TAG_COL
=
[
INT_TAG
]
# insert data args:
TIME_STEP
=
10000
NOW
=
int
(
datetime
.
datetime
.
timestamp
(
datetime
.
datetime
.
now
())
*
1000
)
# init db/table
DBNAME
=
"db"
STBNAME
=
"stb1"
CTBNAME
=
"ct1"
NTBNAME
=
"nt1"
@
dataclass
class
DataSet
:
ts_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
int_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
bint_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
sint_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
tint_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
int_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
bint_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
sint_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
tint_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
float_data
:
List
[
float
]
=
field
(
default_factory
=
list
)
double_data
:
List
[
float
]
=
field
(
default_factory
=
list
)
bool_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
binary_data
:
List
[
str
]
=
field
(
default_factory
=
list
)
nchar_data
:
List
[
str
]
=
field
(
default_factory
=
list
)
@
dataclass
class
BSMAschema
:
creation
:
str
=
"CREATE"
tb_type
:
str
=
"stable"
tbname
:
str
=
STBNAME
cols
:
Tuple
[
str
]
=
None
tags
:
Tuple
[
str
]
=
None
sma_flag
:
str
=
"SMA"
sma_cols
:
Tuple
[
str
]
=
None
create_tabel_sql
:
str
=
None
other
:
Any
=
None
drop
:
str
=
"DROP"
drop_flag
:
str
=
"INDEX"
querySmaOptimize
:
int
=
1
show
:
str
=
"SHOW"
show_msg
:
str
=
"INDEXES"
show_oper
:
str
=
"FROM"
dbname
:
str
=
None
rollup_db
:
bool
=
False
def
__post_init__
(
self
):
if
isinstance
(
self
.
other
,
dict
):
for
k
,
v
in
self
.
other
.
items
():
if
k
.
lower
()
==
"tbname"
and
isinstance
(
v
,
str
)
and
not
self
.
tbname
:
self
.
tbname
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"cols"
and
(
isinstance
(
v
,
tuple
)
or
isinstance
(
v
,
list
))
and
not
self
.
cols
:
self
.
cols
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"tags"
and
(
isinstance
(
v
,
tuple
)
or
isinstance
(
v
,
list
))
and
not
self
.
tags
:
self
.
tags
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"sma_flag"
and
isinstance
(
v
,
str
)
and
not
self
.
sma_flag
:
self
.
sma_flag
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"sma_cols"
and
(
isinstance
(
v
,
tuple
)
or
isinstance
(
v
,
list
))
and
not
self
.
sma_cols
:
self
.
sma_cols
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"create_tabel_sql"
and
isinstance
(
v
,
str
)
and
not
self
.
create_tabel_sql
:
self
.
create_tabel_sql
=
v
del
self
.
other
[
k
]
# bSma show and drop operator is not completed
if
k
.
lower
()
==
"drop_flag"
and
isinstance
(
v
,
str
)
and
not
self
.
drop_flag
:
self
.
drop_flag
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"show_msg"
and
isinstance
(
v
,
str
)
and
not
self
.
show_msg
:
self
.
show_msg
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"dbname"
and
isinstance
(
v
,
str
)
and
not
self
.
dbname
:
self
.
dbname
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"show_oper"
and
isinstance
(
v
,
str
)
and
not
self
.
show_oper
:
self
.
show_oper
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"rollup_db"
and
isinstance
(
v
,
bool
)
and
not
self
.
rollup_db
:
self
.
rollup_db
=
v
del
self
.
other
[
k
]
# from ...pytest.util.sql import *
# from ...pytest.util.constant import *
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
False
)
self
.
precision
=
"ms"
self
.
sma_count
=
0
self
.
sma_created_index
=
[]
def
__create_sma_index
(
self
,
sma
:
BSMAschema
):
if
sma
.
create_tabel_sql
:
sql
=
sma
.
create_tabel_sql
else
:
sql
=
f
"
{
sma
.
creation
}
{
sma
.
tb_type
}
{
sma
.
tbname
}
(
{
', '
.
join
(
sma
.
cols
)
}
) "
if
sma
.
tb_type
==
"stable"
or
(
sma
.
tb_type
==
"table"
and
sma
.
tags
):
sql
=
f
"
{
sma
.
creation
}
{
sma
.
tb_type
}
{
sma
.
tbname
}
(
{
', '
.
join
(
sma
.
cols
)
}
) tags (
{
', '
.
join
(
sma
.
tags
)
}
) "
if
sma
.
sma_flag
:
sql
+=
sma
.
sma_flag
if
sma
.
sma_cols
:
sql
+=
f
"(
{
', '
.
join
(
sma
.
sma_cols
)
}
)"
if
isinstance
(
sma
.
other
,
dict
):
for
k
,
v
in
sma
.
other
.
items
():
if
isinstance
(
v
,
tuple
)
or
isinstance
(
v
,
list
):
sql
+=
f
"
{
k
}
(
{
' '
.
join
(
v
)
}
)"
else
:
sql
+=
f
"
{
k
}
{
v
}
"
if
isinstance
(
sma
.
other
,
tuple
)
or
isinstance
(
sma
.
other
,
list
):
sql
+=
" "
.
join
(
sma
.
other
)
if
isinstance
(
sma
.
other
,
int
)
or
isinstance
(
sma
.
other
,
float
)
or
isinstance
(
sma
.
other
,
str
):
sql
+=
f
"
{
sma
.
other
}
"
return
sql
def
__get_bsma_table_col_tag_str
(
self
,
sql
:
str
):
p
=
re
.
compile
(
r
"[(](.*)[)]"
,
re
.
S
)
if
"tags"
in
(
col_str
:
=
sql
):
col_str
=
re
.
findall
(
p
,
sql
.
split
(
"tags"
)[
0
])[
0
].
split
(
","
)
if
(
tag_str
:
=
re
.
findall
(
p
,
sql
.
split
(
"tags"
)[
1
])[
0
].
split
(
","
)
):
col_str
.
extend
(
tag_str
)
return
col_str
def
__get_bsma_col_tag_names
(
self
,
col_tags
:
list
):
return
[
col_tag
.
strip
().
split
(
" "
)[
0
]
for
col_tag
in
col_tags
]
@
property
def
__get_db_tbname
(
self
):
tb_list
=
[]
tdSql
.
query
(
"show tables"
)
for
row
in
tdSql
.
queryResult
:
tb_list
.
append
(
row
[
0
])
tdSql
.
query
(
"show tables"
)
for
row
in
tdSql
.
queryResult
:
tb_list
.
append
(
row
[
0
])
return
tb_list
def
__bsma_create_check
(
self
,
sma
:
BSMAschema
):
if
not
sma
.
creation
:
return
False
if
not
sma
.
create_tabel_sql
and
(
not
sma
.
tbname
or
not
sma
.
tb_type
or
not
sma
.
cols
):
return
False
if
not
sma
.
create_tabel_sql
and
(
sma
.
tb_type
==
"stable"
and
not
sma
.
tags
):
return
False
if
not
sma
.
sma_flag
or
not
isinstance
(
sma
.
sma_flag
,
str
)
or
sma
.
sma_flag
.
upper
()
!=
"SMA"
:
return
False
if
sma
.
tbname
in
self
.
__get_db_tbname
:
return
False
if
sma
.
create_tabel_sql
:
col_tag_list
=
self
.
__get_bsma_col_tag_names
(
self
.
__get_bsma_table_col_tag_str
(
sma
.
create_tabel_sql
))
else
:
col_str
=
list
(
sma
.
cols
)
if
sma
.
tags
:
col_str
.
extend
(
list
(
sma
.
tags
))
col_tag_list
=
self
.
__get_bsma_col_tag_names
(
col_str
)
if
not
sma
.
sma_cols
:
return
False
for
col
in
sma
.
sma_cols
:
if
col
not
in
col_tag_list
:
return
False
return
True
def
bsma_create_check
(
self
,
sma
:
BSMAschema
):
if
self
.
__bsma_create_check
(
sma
):
tdSql
.
query
(
self
.
__create_sma_index
(
sma
))
tdLog
.
info
(
f
"current sql:
{
self
.
__create_sma_index
(
sma
)
}
"
)
else
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
def
__sma_drop_check
(
self
,
sma
:
BSMAschema
):
pass
def
sma_drop_check
(
self
,
sma
:
BSMAschema
):
pass
def
__show_sma_index
(
self
,
sma
:
BSMAschema
):
pass
def
__sma_show_check
(
self
,
sma
:
BSMAschema
):
pass
def
sma_show_check
(
self
,
sma
:
BSMAschema
):
pass
@
property
def
__create_sma_sql
(
self
):
err_sqls
=
[]
cur_sqls
=
[]
# err_set
### case 1: required fields check
err_sqls
.
append
(
BSMAschema
(
creation
=
""
,
tbname
=
"stb2"
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_cols
=
(
PRIMARY_COL
,
INT_COL
)
)
)
err_sqls
.
append
(
BSMAschema
(
tbname
=
""
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_cols
=
(
PRIMARY_COL
,
INT_COL
)
)
)
err_sqls
.
append
(
BSMAschema
(
tbname
=
"stb2"
,
cols
=
(),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_cols
=
(
PRIMARY_COL
,
INT_COL
)
)
)
err_sqls
.
append
(
BSMAschema
(
tbname
=
"stb2"
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(),
sma_cols
=
(
PRIMARY_COL
,
INT_COL
)
)
)
err_sqls
.
append
(
BSMAschema
(
tbname
=
"stb2"
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_flag
=
""
,
sma_cols
=
(
PRIMARY_COL
,
INT_COL
)
)
)
err_sqls
.
append
(
BSMAschema
(
tbname
=
"stb2"
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_cols
=
()
)
)
### case 2:
err_sqls
.
append
(
BSMAschema
(
tbname
=
"stb2"
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_cols
=
({
BINT_COL
})
)
)
# current_set
cur_sqls
.
append
(
BSMAschema
(
tbname
=
"stb2"
,
cols
=
(
f
"
{
PRIMARY_COL
}
timestamp"
,
f
"
{
INT_COL
}
int"
),
tags
=
(
f
"
{
INT_TAG
}
int"
,),
sma_cols
=
(
PRIMARY_COL
,
INT_COL
)
)
)
return
err_sqls
,
cur_sqls
def
test_create_sma
(
self
):
err_sqls
,
cur_sqls
=
self
.
__create_sma_sql
for
err_sql
in
err_sqls
:
self
.
bsma_create_check
(
err_sql
)
for
cur_sql
in
cur_sqls
:
self
.
bsma_create_check
(
cur_sql
)
@
property
def
__drop_sma_sql
(
self
):
err_sqls
=
[]
cur_sqls
=
[]
# err_set
## case 1: required fields check
return
err_sqls
,
cur_sqls
def
test_drop_sma
(
self
):
err_sqls
,
cur_sqls
=
self
.
__drop_sma_sql
for
err_sql
in
err_sqls
:
self
.
sma_drop_check
(
err_sql
)
for
cur_sql
in
cur_sqls
:
self
.
sma_drop_check
(
cur_sql
)
def
all_test
(
self
):
self
.
test_create_sma
()
def
__create_tb
(
self
):
tdLog
.
printNoPrefix
(
"==========step: create table"
)
create_stb_sql
=
f
'''create table
{
STBNAME
}
(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp,
{
TINT_UN_COL
}
tinyint unsigned,
{
SINT_UN_COL
}
smallint unsigned,
{
INT_UN_COL
}
int unsigned,
{
BINT_UN_COL
}
bigint unsigned
) tags (
{
INT_TAG
}
int)
'''
create_ntb_sql
=
f
'''create table
{
NTBNAME
}
(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp,
{
TINT_UN_COL
}
tinyint unsigned,
{
SINT_UN_COL
}
smallint unsigned,
{
INT_UN_COL
}
int unsigned,
{
BINT_UN_COL
}
bigint unsigned
)
'''
tdSql
.
execute
(
create_stb_sql
)
tdSql
.
execute
(
create_ntb_sql
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags (
{
i
+
1
}
)'
)
def
__data_set
(
self
,
rows
):
data_set
=
DataSet
()
for
i
in
range
(
rows
):
data_set
.
ts_data
.
append
(
NOW
+
1
*
(
rows
-
i
))
data_set
.
int_data
.
append
(
rows
-
i
)
data_set
.
bint_data
.
append
(
11111
*
(
rows
-
i
))
data_set
.
sint_data
.
append
(
111
*
(
rows
-
i
)
%
32767
)
data_set
.
tint_data
.
append
(
11
*
(
rows
-
i
)
%
127
)
data_set
.
int_un_data
.
append
(
rows
-
i
)
data_set
.
bint_un_data
.
append
(
11111
*
(
rows
-
i
))
data_set
.
sint_un_data
.
append
(
111
*
(
rows
-
i
)
%
32767
)
data_set
.
tint_un_data
.
append
(
11
*
(
rows
-
i
)
%
127
)
data_set
.
float_data
.
append
(
1.11
*
(
rows
-
i
))
data_set
.
double_data
.
append
(
1100.0011
*
(
rows
-
i
))
data_set
.
bool_data
.
append
((
rows
-
i
)
%
2
)
data_set
.
binary_data
.
append
(
f
'binary
{
(
rows
-
i
)
}
'
)
data_set
.
nchar_data
.
append
(
f
'nchar_测试_
{
(
rows
-
i
)
}
'
)
return
data_set
def
__insert_data
(
self
):
tdLog
.
printNoPrefix
(
"==========step: start inser data into tables now....."
)
data
=
self
.
__data_set
(
rows
=
self
.
rows
)
# now_time = int(datetime.datetime.timestamp(datetime.datetime.now()) * 1000)
null_data
=
'''null, null, null, null, null, null, null, null, null, null, null, null, null, null'''
zero_data
=
"0, 0, 0, 0, 0, 0, 0, 'binary_0', 'nchar_0', 0, 0, 0, 0, 0"
for
i
in
range
(
self
.
rows
):
row_data
=
f
'''
{
data
.
int_data
[
i
]
}
,
{
data
.
bint_data
[
i
]
}
,
{
data
.
sint_data
[
i
]
}
,
{
data
.
tint_data
[
i
]
}
,
{
data
.
float_data
[
i
]
}
,
{
data
.
double_data
[
i
]
}
,
{
data
.
bool_data
[
i
]
}
, '
{
data
.
binary_data
[
i
]
}
', '
{
data
.
nchar_data
[
i
]
}
',
{
data
.
ts_data
[
i
]
}
,
{
data
.
tint_un_data
[
i
]
}
,
{
data
.
sint_un_data
[
i
]
}
,
{
data
.
int_un_data
[
i
]
}
,
{
data
.
bint_un_data
[
i
]
}
'''
neg_row_data
=
f
'''
{
-
1
*
data
.
int_data
[
i
]
}
,
{
-
1
*
data
.
bint_data
[
i
]
}
,
{
-
1
*
data
.
sint_data
[
i
]
}
,
{
-
1
*
data
.
tint_data
[
i
]
}
,
{
-
1
*
data
.
float_data
[
i
]
}
,
{
-
1
*
data
.
double_data
[
i
]
}
,
{
data
.
bool_data
[
i
]
}
, '
{
data
.
binary_data
[
i
]
}
', '
{
data
.
nchar_data
[
i
]
}
',
{
data
.
ts_data
[
i
]
}
,
{
1
*
data
.
tint_un_data
[
i
]
}
,
{
1
*
data
.
sint_un_data
[
i
]
}
,
{
1
*
data
.
int_un_data
[
i
]
}
,
{
1
*
data
.
bint_un_data
[
i
]
}
'''
tdSql
.
execute
(
f
"insert into ct1 values (
{
NOW
-
i
*
TIME_STEP
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct2 values (
{
NOW
-
i
*
int
(
TIME_STEP
*
0.6
)
}
,
{
neg_row_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
-
i
*
int
(
TIME_STEP
*
0.8
)
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
i
*
int
(
TIME_STEP
*
1.2
)
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct2 values (
{
NOW
+
int
(
TIME_STEP
*
0.6
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct2 values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
0.6
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct2 values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.29
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
+
int
(
TIME_STEP
*
0.8
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
0.8
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.39
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
+
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.59
)
}
,
{
null_data
}
)"
)
def
run
(
self
):
self
.
rows
=
10
tdLog
.
printNoPrefix
(
"==========step0:all check"
)
tdLog
.
printNoPrefix
(
"==========step1:create table in normal database"
)
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
# drop databases, create same name db、stb and sma index
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
tdLog
.
printNoPrefix
(
"==========step2:create table in rollup database"
)
tdSql
.
execute
(
"create database db3 retentions 1s:4m,2s:8m,3s:12m"
)
tdSql
.
execute
(
"use db3"
)
tdSql
.
query
(
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(first) watermark 5s max_delay 1m sma(
{
INT_COL
}
)"
)
tdSql
.
execute
(
"drop database if exists db1 "
)
tdSql
.
execute
(
"drop database if exists db2 "
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
printNoPrefix
(
"==========step4:after wal, all check again "
)
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
# drop databases, create same name db、stb and sma index
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tests/system-test/1-insert/create_retentions.py
浏览文件 @
ba72ce2b
import
datetime
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
,
field
from
typing
import
List
from
util.log
import
*
from
util.sql
import
*
...
...
@@ -36,36 +36,20 @@ NOW = int(datetime.datetime.timestamp(datetime.datetime.now()) * 1000)
@
dataclass
class
DataSet
:
ts_data
:
List
[
int
]
=
None
int_data
:
List
[
int
]
=
None
bint_data
:
List
[
int
]
=
None
sint_data
:
List
[
int
]
=
None
tint_data
:
List
[
int
]
=
None
int_un_data
:
List
[
int
]
=
None
bint_un_data
:
List
[
int
]
=
None
sint_un_data
:
List
[
int
]
=
None
tint_un_data
:
List
[
int
]
=
None
float_data
:
List
[
float
]
=
None
double_data
:
List
[
float
]
=
None
bool_data
:
List
[
int
]
=
None
binary_data
:
List
[
str
]
=
None
nchar_data
:
List
[
str
]
=
None
def
__post_init__
(
self
):
self
.
ts_data
=
[]
self
.
int_data
=
[]
self
.
bint_data
=
[]
self
.
sint_data
=
[]
self
.
tint_data
=
[]
self
.
int_un_data
=
[]
self
.
bint_un_data
=
[]
self
.
sint_un_data
=
[]
self
.
tint_un_data
=
[]
self
.
float_data
=
[]
self
.
double_data
=
[]
self
.
bool_data
=
[]
self
.
binary_data
=
[]
self
.
nchar_data
=
[]
ts_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
int_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
bint_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
sint_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
tint_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
int_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
bint_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
sint_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
tint_un_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
float_data
:
List
[
float
]
=
field
(
default_factory
=
list
)
double_data
:
List
[
float
]
=
field
(
default_factory
=
list
)
bool_data
:
List
[
int
]
=
field
(
default_factory
=
list
)
binary_data
:
List
[
str
]
=
field
(
default_factory
=
list
)
nchar_data
:
List
[
str
]
=
field
(
default_factory
=
list
)
class
TDTestCase
:
...
...
@@ -107,15 +91,15 @@ class TDTestCase:
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(count) watermark 1min"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max_delay -1s"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark -1m"
,
#
f"create stable stb1 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) watermark 1m ",
#
f"create stable stb1 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) max_delay 1m ",
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) watermark 1m "
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) max_delay 1m "
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
BINARY_COL
}
binary(16)) tags (tag1 int) rollup(avg) watermark 1s"
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
BINARY
_COL
}
nchar(16)) tags (tag1 int) rollup(avg) max_delay 1m"
,
# f"create table ntb_1 ({PRIMARY_COL} timestamp, {INT_COL} int, {
BINARY
_COL} nchar(16)) rollup(avg) watermark 1s max_delay 1s",
# f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int, {BINARY
_COL} nchar(16)) tags (tag1 int) " ,
#
f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) " ,
#
f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int) " ,
#
f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int, {BINARY_COL} nchar(16)) " ,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
NCHAR
_COL
}
nchar(16)) tags (tag1 int) rollup(avg) max_delay 1m"
,
# f"create table ntb_1 ({PRIMARY_COL} timestamp, {INT_COL} int, {
NCHAR
_COL} nchar(16)) rollup(avg) watermark 1s max_delay 1s",
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
NCHAR
_COL
}
nchar(16)) tags (tag1 int) "
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) "
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) "
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
BINARY_COL
}
nchar(16)) "
,
# watermark, max_delay: [0, 900000], [ms, s, m, ?]
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max_delay 1u"
,
...
...
@@ -136,8 +120,9 @@ class TDTestCase:
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark 5s max_delay 1m"
,
f
"create stable stb3 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(max) watermark 5s max_delay 1m"
,
f
"create stable stb4 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(sum) watermark 5s max_delay 1m"
,
# f"create stable stb5 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) rollup(last) watermark 5s max_delay 1m",
# f"create stable stb6 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) rollup(first) watermark 5s max_delay 1m",
f
"create stable stb5 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(last) watermark 5s max_delay 1m"
,
f
"create stable stb6 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(first) watermark 5s max_delay 1m"
,
f
"create stable stb7 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(first) watermark 5s max_delay 1m sma(
{
INT_COL
}
)"
,
]
def
test_create_stb
(
self
):
...
...
@@ -150,7 +135,7 @@ class TDTestCase:
# assert "rollup" in tdSql.description
tdSql
.
checkRows
(
len
(
self
.
create_stable_sql_current
))
# tdSql.execute("use db") # because db is a noraml database, not a rollup database, should not be able to create a rollup databas
e
tdSql
.
execute
(
"use db"
)
# because db is a noraml database, not a rollup database, should not be able to create a rollup stabl
e
# tdSql.error(f"create stable nor_db_rollup_stb ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) watermark 5s max_delay 1m")
...
...
@@ -210,20 +195,6 @@ class TDTestCase:
data_set
.
binary_data
.
append
(
f
'binary
{
(
rows
-
i
)
}
'
)
data_set
.
nchar_data
.
append
(
f
'nchar_测试_
{
(
rows
-
i
)
}
'
)
# neg_data_set.ts_data.append(-1 * i)
# neg_data_set.int_data.append(-i)
# neg_data_set.bint_data.append(-11111 * i)
# neg_data_set.sint_data.append(-111 * i % 32767)
# neg_data_set.tint_data.append(-11 * i % 127)
# neg_data_set.int_un_data.append(-i)
# neg_data_set.bint_un_data.append(-11111 * i)
# neg_data_set.sint_un_data.append(-111 * i % 32767)
# neg_data_set.tint_un_data.append(-11 * i % 127)
# neg_data_set.float_data.append(-1.11 * i)
# neg_data_set.double_data.append(-1100.0011 * i)
# neg_data_set.binary_data.append(f'binary{i}')
# neg_data_set.nchar_data.append(f'nchar_测试_{i}')
return
data_set
def
__insert_data
(
self
):
...
...
@@ -279,9 +250,14 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"==========step2:create table in rollup database"
)
tdSql
.
execute
(
"create database db3 retentions 1s:4m,2s:8m,3s:12m"
)
tdSql
.
execute
(
"drop database if exists db1 "
)
tdSql
.
execute
(
"drop database if exists db2 "
)
tdSql
.
execute
(
"use db3"
)
self
.
__create_tb
()
self
.
__insert_data
()
# self.__create_tb()
# self.__insert_data()
self
.
all_test
()
tdSql
.
execute
(
"drop database if exists db1 "
)
tdSql
.
execute
(
"drop database if exists db2 "
)
...
...
tests/system-test/1-insert/time_range_wise.py
浏览文件 @
ba72ce2b
...
...
@@ -325,7 +325,7 @@ class TDTestCase:
def
__sma_create_check
(
self
,
sma
:
SMAschema
):
if
self
.
updatecfgDict
[
"querySmaOptimize"
]
==
0
:
return
False
#
#
TODO: if database is a rollup-db, can not create sma index
# TODO: if database is a rollup-db, can not create sma index
# tdSql.query("select database()")
# if sma.rollup_db :
# return False
...
...
@@ -493,8 +493,8 @@ class TDTestCase:
err_sqls
,
cur_sqls
=
self
.
__drop_sma_sql
for
err_sql
in
err_sqls
:
self
.
sma_drop_check
(
err_sql
)
#
for cur_sql in cur_sqls:
#
self.sma_drop_check(cur_sql)
for
cur_sql
in
cur_sqls
:
self
.
sma_drop_check
(
cur_sql
)
def
all_test
(
self
):
self
.
test_create_sma
()
...
...
@@ -605,24 +605,23 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"==========step1:create table in normal database"
)
tdSql
.
prepare
()
self
.
__create_tb
()
#
self.__insert_data()
self
.
__insert_data
()
self
.
all_test
()
# drop databases, create same name db、stb and sma index
# tdSql.prepare()
# self.__create_tb()
# self.__insert_data()
# self.all_test()
return
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
tdLog
.
printNoPrefix
(
"==========step2:create table in rollup database"
)
tdSql
.
execute
(
"create database db3 retentions 1s:4m,2s:8m,3s:12m"
)
tdSql
.
execute
(
"use db3"
)
self
.
__create_tb
()
self
.
__insert_data
()
# self.__create_tb()
tdSql
.
execute
(
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(first) watermark 5s max_delay 1m sma(
{
INT_COL
}
) "
)
self
.
all_test
()
# self.__insert_data()
tdSql
.
execute
(
"drop database if exists db1 "
)
tdSql
.
execute
(
"drop database if exists db2 "
)
...
...
tests/system-test/2-query/json_tag.py
浏览文件 @
ba72ce2b
...
...
@@ -566,7 +566,7 @@ class TDTestCase:
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select bottom(dataint,100) from jsons1 where jtag->'tag1'>1"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select percentile(dataint,20) from jsons1 where jtag->'tag1'>1"
)
#
tdSql.query("select percentile(dataint,20) from jsons1 where jtag->'tag1'>1")
tdSql
.
query
(
"select apercentile(dataint, 50) from jsons1 where jtag->'tag1'>1"
)
tdSql
.
checkData
(
0
,
0
,
1.5
)
# tdSql.query("select last_row(dataint) from jsons1 where jtag->'tag1'>1")
...
...
tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py
0 → 100644
浏览文件 @
ba72ce2b
import
taos
import
sys
import
time
import
socket
import
os
import
threading
import
math
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
from
util.common
import
*
sys
.
path
.
append
(
"./7-tmq"
)
from
tmqCommon
import
*
class
TDTestCase
:
def
__init__
(
self
):
self
.
vgroups
=
4
self
.
ctbNum
=
10
self
.
rowsPerTbl
=
10000
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
False
)
def
prepareTestEnv
(
self
):
tdLog
.
printNoPrefix
(
"======== prepare test env include database, stable, ctables, and insert data: "
)
paraDict
=
{
'dbName'
:
'dbt'
,
'dropFlag'
:
1
,
'event'
:
''
,
'vgroups'
:
1
,
'stbName'
:
'stb'
,
'colPrefix'
:
'c'
,
'tagPrefix'
:
't'
,
'colSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'TIMESTAMP'
,
'count'
:
1
}],
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'rowsPerTbl'
:
10000
,
'batchNum'
:
10
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
3
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
paraDict
[
'vgroups'
]
=
self
.
vgroups
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
tmqCom
.
initConsumerTable
()
tdCom
.
create_database
(
tdSql
,
paraDict
[
"dbName"
],
paraDict
[
"dropFlag"
],
vgroups
=
paraDict
[
"vgroups"
],
replica
=
1
)
tdLog
.
info
(
"create stb"
)
tmqCom
.
create_stable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
])
tdLog
.
info
(
"create ctb"
)
tmqCom
.
create_ctable
(
tdSql
,
dbName
=
paraDict
[
"dbName"
],
stbName
=
paraDict
[
"stbName"
],
ctbPrefix
=
paraDict
[
'ctbPrefix'
],
ctbNum
=
paraDict
[
"ctbNum"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
tdLog
.
info
(
"insert data"
)
tmqCom
.
insert_data_interlaceByMultiTbl
(
tsql
=
tdSql
,
dbName
=
paraDict
[
"dbName"
],
ctbPrefix
=
paraDict
[
"ctbPrefix"
],
ctbNum
=
paraDict
[
"ctbNum"
],
rowsPerTbl
=
paraDict
[
"rowsPerTbl"
],
batchNum
=
paraDict
[
"batchNum"
],
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
tdLog
.
info
(
"restart taosd to ensure that the data falls into the disk"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
return
def
tmqCase3
(
self
):
tdLog
.
printNoPrefix
(
"======== test case 3: "
)
paraDict
=
{
'dbName'
:
'dbt'
,
'dropFlag'
:
1
,
'event'
:
''
,
'vgroups'
:
1
,
'stbName'
:
'stb'
,
'colPrefix'
:
'c'
,
'tagPrefix'
:
't'
,
'colSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'TIMESTAMP'
,
'count'
:
1
}],
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'rowsPerTbl'
:
10000
,
'batchNum'
:
10
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
10
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
paraDict
[
'vgroups'
]
=
self
.
vgroups
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
topicNameList
=
[
'topic1'
]
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"create topics from stb with filter"
)
queryString
=
"select * from %s.%s"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
# sqlString = "create topic %s as stable %s" %(topicNameList[0], paraDict['stbName'])
sqlString
=
"create topic %s as %s"
%
(
topicNameList
[
0
],
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
query
(
queryString
)
expectRowsList
.
append
(
tdSql
.
getRows
())
totalRowsInserted
=
expectRowsList
[
0
]
# init consume info, and start tmq_sim, then check consume result
tdLog
.
info
(
"insert consume info to consume processor"
)
consumerId
=
3
expectrowcnt
=
math
.
ceil
(
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
/
3
)
topicList
=
topicNameList
[
0
]
ifcheckdata
=
1
ifManualCommit
=
1
keyList
=
'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest'
tmqCom
.
insertConsumerInfo
(
consumerId
,
expectrowcnt
,
topicList
,
keyList
,
ifcheckdata
,
ifManualCommit
)
consumerId
=
4
expectrowcnt
=
math
.
ceil
(
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
*
2
/
3
)
tmqCom
.
insertConsumerInfo
(
consumerId
,
expectrowcnt
,
topicList
,
keyList
,
ifcheckdata
,
ifManualCommit
)
tdLog
.
info
(
"start consume processor 0"
)
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
tdLog
.
info
(
"wait the consume result"
)
expectRows
=
2
resultList
=
tmqCom
.
selectConsumeResult
(
expectRows
)
actConsumeTotalRows
=
resultList
[
0
]
+
resultList
[
1
]
if
not
(
totalRowsInserted
==
actConsumeTotalRows
):
tdLog
.
info
(
"sum of two consume rows: %d should be equal to total inserted rows: %d"
%
(
actConsumeTotalRows
,
totalRowsInserted
))
tdLog
.
exit
(
"%d tmq consume rows error!"
%
consumerId
)
time
.
sleep
(
10
)
for
i
in
range
(
len
(
topicNameList
)):
tdSql
.
query
(
"drop topic %s"
%
topicNameList
[
i
])
tdLog
.
printNoPrefix
(
"======== test case 3 end ...... "
)
def
tmqCase4
(
self
):
tdLog
.
printNoPrefix
(
"======== test case 4: "
)
paraDict
=
{
'dbName'
:
'dbt'
,
'dropFlag'
:
1
,
'event'
:
''
,
'vgroups'
:
1
,
'stbName'
:
'stb'
,
'colPrefix'
:
'c'
,
'tagPrefix'
:
't'
,
'colSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'TIMESTAMP'
,
'count'
:
1
}],
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'rowsPerTbl'
:
10000
,
'batchNum'
:
10
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
10
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
paraDict
[
'vgroups'
]
=
self
.
vgroups
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
topicNameList
=
[
'topic1'
]
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"create topics from stb with filter"
)
queryString
=
"select * from %s.%s"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
# sqlString = "create topic %s as stable %s" %(topicNameList[0], paraDict['stbName'])
sqlString
=
"create topic %s as %s"
%
(
topicNameList
[
0
],
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
query
(
queryString
)
expectRowsList
.
append
(
tdSql
.
getRows
())
totalRowsInserted
=
expectRowsList
[
0
]
# init consume info, and start tmq_sim, then check consume result
tdLog
.
info
(
"insert consume info to consume processor"
)
consumerId
=
5
expectrowcnt
=
math
.
ceil
(
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
])
topicList
=
topicNameList
[
0
]
ifcheckdata
=
1
ifManualCommit
=
1
keyList
=
'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest'
tmqCom
.
insertConsumerInfo
(
consumerId
,
expectrowcnt
,
topicList
,
keyList
,
ifcheckdata
,
ifManualCommit
)
tdLog
.
info
(
"start consume processor 0"
)
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
tdLog
.
info
(
"wait commit notify"
)
tmqCom
.
getStartCommitNotifyFromTmqsim
()
tdLog
.
info
(
"pkill consume processor"
)
tdCom
.
killProcessor
(
"tmq_sim"
)
# time.sleep(10)
# reinit consume info, and start tmq_sim, then check consume result
tmqCom
.
initConsumerTable
()
consumerId
=
6
tmqCom
.
insertConsumerInfo
(
consumerId
,
expectrowcnt
,
topicList
,
keyList
,
ifcheckdata
,
ifManualCommit
)
tdLog
.
info
(
"start consume processor 1"
)
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
tdLog
.
info
(
"wait the consume result"
)
expectRows
=
1
resultList
=
tmqCom
.
selectConsumeResult
(
expectRows
)
actConsumeTotalRows
=
resultList
[
0
]
if
not
(
actConsumeTotalRows
>
0
and
actConsumeTotalRows
<
totalRowsInserted
):
tdLog
.
info
(
"act consume rows: %d"
%
(
actConsumeTotalRows
))
tdLog
.
info
(
"and second consume rows should be between 0 and %d"
%
(
totalRowsInserted
))
tdLog
.
exit
(
"%d tmq consume rows error!"
%
consumerId
)
time
.
sleep
(
10
)
for
i
in
range
(
len
(
topicNameList
)):
tdSql
.
query
(
"drop topic %s"
%
topicNameList
[
i
])
tdLog
.
printNoPrefix
(
"======== test case 4 end ...... "
)
def
run
(
self
):
tdSql
.
prepare
()
self
.
prepareTestEnv
()
self
.
tmqCase3
()
self
.
tmqCase4
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
event
=
threading
.
Event
()
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tests/system-test/7-tmq/tmqConsFromTsdb1.py
浏览文件 @
ba72ce2b
...
...
@@ -85,7 +85,7 @@ class TDTestCase:
'rowsPerTbl'
:
10000
,
'batchNum'
:
10
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
1
0
,
'pollDelay'
:
1
5
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
...
...
tests/system-test/fulltest.sh
浏览文件 @
ba72ce2b
...
...
@@ -19,11 +19,15 @@ python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py
python3 ./test.py
-f
1-insert/opentsdb_telnet_line_taosc_insert.py
python3 ./test.py
-f
1-insert/opentsdb_json_taosc_insert.py
python3 ./test.py
-f
1-insert/test_stmt_muti_insert_query.py
python3 ./test.py
-f
1-insert/test_stmt_set_tbname_tag.py
python3 ./test.py
-f
1-insert/test_stmt_set_tbname_tag.py
python3 ./test.py
-f
1-insert/alter_stable.py
python3 ./test.py
-f
1-insert/alter_table.py
python3 ./test.py
-f
1-insert/insertWithMoreVgroup.py
python3 ./test.py
-f
1-insert/table_comment.py
python3 ./test.py
-f
1-insert/time_range_wise.py
python3 ./test.py
-f
1-insert/block_wise.py
python3 ./test.py
-f
1-insert/create_retentions.py
#python3 ./test.py -f 1-insert/table_param_ttl.py
python3 ./test.py
-f
2-query/between.py
python3 ./test.py
-f
2-query/distinct.py
...
...
@@ -114,19 +118,19 @@ python3 ./test.py -f 2-query/twa.py
python3 ./test.py
-f
2-query/irate.py
python3 ./test.py
-f
2-query/function_null.py
python3 ./test.py
-f
2-query/queryQnode.py
python3 ./test.py
-f
2-query/queryQnode.py
#python3 ./test.py -f 6-cluster/5dnode1mnode.py
#python3 ./test.py -f 6-cluster/5dnode1mnode.py
#python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3
#python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
#python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3
python3 ./test.py
-f
6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py
-N
5
-M
3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3
# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py
# python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5
# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3
...
...
@@ -158,3 +162,4 @@ python3 ./test.py -f 7-tmq/tmqAlterSchema.py
python3 ./test.py
-f
7-tmq/tmqConsFromTsdb.py
python3 ./test.py
-f
7-tmq/tmqConsFromTsdb1.py
python3 ./test.py
-f
7-tmq/tmqConsFromTsdb-mutilVg.py
python3 ./test.py
-f
7-tmq/tmqConsFromTsdb1-mutilVg.py
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录