Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
48c0805f
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
48c0805f
编写于
4月 02, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/taosdata/TDengine
into develop
上级
4cbaacb2
763a14c8
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
1028 addition
and
718 deletion
+1028
-718
documentation20/cn/02.getting-started/docs.md
documentation20/cn/02.getting-started/docs.md
+14
-13
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+3
-6
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+50
-19
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-1
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+4
-2
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+251
-215
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-1
src/query/inc/sql.y
src/query/inc/sql.y
+1
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+50
-5
src/query/src/qSqlParser.c
src/query/src/qSqlParser.c
+11
-2
src/query/src/qUtil.c
src/query/src/qUtil.c
+4
-7
src/query/src/queryMain.c
src/query/src/queryMain.c
+1
-0
src/query/src/sql.c
src/query/src/sql.c
+344
-338
src/sync/inc/syncInt.h
src/sync/inc/syncInt.h
+1
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+6
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+2
-2
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+5
-1
tests/examples/go/taosdemo.go
tests/examples/go/taosdemo.go
+100
-95
tests/pytest/tools/insert-tblimit-tboffset-createdb.json
tests/pytest/tools/insert-tblimit-tboffset-createdb.json
+57
-0
tests/pytest/tools/insert-tblimit-tboffset-insertrec.json
tests/pytest/tools/insert-tblimit-tboffset-insertrec.json
+59
-0
tests/pytest/tools/insert-tblimit-tboffset0.json
tests/pytest/tools/insert-tblimit-tboffset0.json
+2
-2
tests/pytest/tools/insert-tblimit1-tboffset.json
tests/pytest/tools/insert-tblimit1-tboffset.json
+2
-2
tests/pytest/tools/taosdemo-sampledata.json
tests/pytest/tools/taosdemo-sampledata.json
+0
-2
tests/pytest/tools/taosdemoTestLimitOffset.py
tests/pytest/tools/taosdemoTestLimitOffset.py
+4
-1
tests/pytest/tools/taosdemoTestSampleData.py
tests/pytest/tools/taosdemoTestSampleData.py
+1
-1
tests/script/general/parser/topbot.sim
tests/script/general/parser/topbot.sim
+52
-0
未找到文件。
documentation20/cn/02.getting-started/docs.md
浏览文件 @
48c0805f
...
...
@@ -179,19 +179,20 @@ taos> select avg(f1), max(f2), min(f3) from test.t10 interval(10s);
### TDengine服务器支持的平台列表
| |
**CentOS 6/7/8**
|
**Ubuntu 16/18/20**
|
**Other Linux**
|
**统信 UOS**
|
**银河/中标麒麟**
|
**凝思 V60/V80**
|
| -------------- | --------------------- | ------------------------ | --------------- | --------------- | ------------------------- | --------------------- |
| X64 | ● | ● | | ○ | ● | ● |
| 树莓派 ARM32 | | ● | ● | | | |
| 龙芯 MIPS64 | | | ● | | | |
| 鲲鹏 ARM64 | | ○ | ○ | | ● | |
| 申威 Alpha64 | | | ○ | ● | | |
| 飞腾 ARM64 | | ○ 优麒麟 | | | | |
| 海光 X64 | ● | ● | ● | ○ | ● | ● |
| 瑞芯微 ARM64/32 | | | ○ | | | |
| 全志 ARM64/32 | | | ○ | | | |
| 炬力 ARM64/32 | | | ○ | | | |
| TI ARM32 | | | ○ | | | |
| |
**CentOS 6/7/8**
|
**Ubuntu 16/18/20**
|
**Other Linux**
|
**统信 UOS**
|
**银河/中标麒麟**
|
**凝思 V60/V80**
|
**华为 EulerOS**
|
| -------------- | --------------------- | ------------------------ | --------------- | --------------- | ------------------------- | --------------------- | --------------------- |
| X64 | ● | ● | | ○ | ● | ● | ● |
| 树莓派 ARM32 | | ● | ● | | | | |
| 龙芯 MIPS64 | | | ● | | | | |
| 鲲鹏 ARM64 | | ○ | ○ | | ● | | |
| 申威 Alpha64 | | | ○ | ● | | | |
| 飞腾 ARM64 | | ○ 优麒麟 | | | | | |
| 海光 X64 | ● | ● | ● | ○ | ● | ● | |
| 瑞芯微 ARM64/32 | | | ○ | | | | |
| 全志 ARM64/32 | | | ○ | | | | |
| 炬力 ARM64/32 | | | ○ | | | | |
| TI ARM32 | | | ○ | | | | |
| 华为云 ARM64 | | | | | | | ● |
注: ● 表示经过官方测试验证, ○ 表示非官方测试验证。
...
...
src/client/src/tscAsync.c
浏览文件 @
48c0805f
...
...
@@ -505,10 +505,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
return
;
_error:
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pSql
->
res
.
code
=
code
;
pRes
->
code
=
code
;
tscAsyncResultOnError
(
pSql
);
}
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
}
src/client/src/tscSQLParser.c
浏览文件 @
48c0805f
...
...
@@ -3293,7 +3293,8 @@ static int32_t extractColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SC
}
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
pExpr
->
tokenId
!=
TK_EQ
&&
pExpr
->
tokenId
!=
TK_NE
)
{
int32_t
t
=
pExpr
->
tokenId
;
if
(
t
!=
TK_EQ
&&
t
!=
TK_NE
&&
t
!=
TK_NOTNULL
&&
t
!=
TK_ISNULL
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
}
}
...
...
@@ -3493,7 +3494,8 @@ static int32_t validateSQLExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, SQueryInfo* pQuer
}
pList
->
ids
[
pList
->
num
++
]
=
index
;
}
else
if
(
pExpr
->
tokenId
==
TK_FLOAT
&&
(
isnan
(
pExpr
->
value
.
dKey
)
||
isinf
(
pExpr
->
value
.
dKey
)))
{
}
else
if
((
pExpr
->
tokenId
==
TK_FLOAT
&&
(
isnan
(
pExpr
->
value
.
dKey
)
||
isinf
(
pExpr
->
value
.
dKey
)))
||
pExpr
->
tokenId
==
TK_NULL
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
else
if
(
pExpr
->
type
==
SQL_NODE_SQLFUNCTION
)
{
if
(
*
type
==
NON_ARITHMEIC_EXPR
)
{
...
...
@@ -3727,6 +3729,39 @@ static int32_t setExprToCond(tSqlExpr** parent, tSqlExpr* pExpr, const char* msg
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
validateNullExpr
(
tSqlExpr
*
pExpr
,
char
*
msgBuf
)
{
const
char
*
msg
=
"only support is [not] null"
;
tSqlExpr
*
pRight
=
pExpr
->
pRight
;
if
(
pRight
->
tokenId
==
TK_NULL
&&
(
!
(
pExpr
->
tokenId
==
TK_ISNULL
||
pExpr
->
tokenId
==
TK_NOTNULL
)))
{
return
invalidSqlErrMsg
(
msgBuf
,
msg
);
}
return
TSDB_CODE_SUCCESS
;
}
// check for like expression
static
int32_t
validateLikeExpr
(
tSqlExpr
*
pExpr
,
STableMeta
*
pTableMeta
,
int32_t
index
,
char
*
msgBuf
)
{
const
char
*
msg1
=
"wildcard string should be less than 20 characters"
;
const
char
*
msg2
=
"illegal column name"
;
tSqlExpr
*
pLeft
=
pExpr
->
pLeft
;
tSqlExpr
*
pRight
=
pExpr
->
pRight
;
if
(
pExpr
->
tokenId
==
TK_LIKE
)
{
if
(
pRight
->
value
.
nLen
>
TSDB_PATTERN_STRING_MAX_LEN
)
{
return
invalidSqlErrMsg
(
msgBuf
,
msg1
);
}
SSchema
*
pSchema
=
tscGetTableSchema
(
pTableMeta
);
if
((
!
isTablenameToken
(
&
pLeft
->
colInfo
))
&&
!
IS_VAR_DATA_TYPE
(
pSchema
[
index
].
type
))
{
return
invalidSqlErrMsg
(
msgBuf
,
msg2
);
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
handleExprInQueryCond
(
SSqlCmd
*
pCmd
,
SQueryInfo
*
pQueryInfo
,
tSqlExpr
**
pExpr
,
SCondExpr
*
pCondExpr
,
int32_t
*
type
,
int32_t
parentOptr
)
{
const
char
*
msg1
=
"table query cannot use tags filter"
;
...
...
@@ -3736,7 +3771,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
const
char
*
msg5
=
"not support ordinary column join"
;
const
char
*
msg6
=
"only one query condition on tbname allowed"
;
const
char
*
msg7
=
"only in/like allowed in filter table name"
;
const
char
*
msg8
=
"wildcard string should be less than 20 characters"
;
tSqlExpr
*
pLeft
=
(
*
pExpr
)
->
pLeft
;
tSqlExpr
*
pRight
=
(
*
pExpr
)
->
pRight
;
...
...
@@ -3753,6 +3787,18 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
.
tableIndex
);
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
// validate the null expression
int32_t
code
=
validateNullExpr
(
*
pExpr
,
tscGetErrorMsgPayload
(
pCmd
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
// validate the like expression
code
=
validateLikeExpr
(
*
pExpr
,
pTableMeta
,
index
.
columnIndex
,
tscGetErrorMsgPayload
(
pCmd
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
if
(
index
.
columnIndex
==
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
{
// query on time range
if
(
!
validateJoinExprNode
(
pCmd
,
pQueryInfo
,
*
pExpr
,
&
index
))
{
return
TSDB_CODE_TSC_INVALID_SQL
;
...
...
@@ -3774,7 +3820,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
int16_t
leftIdx
=
index
.
tableIndex
;
SColumnIndex
index
=
COLUMN_INDEX_INITIALIZER
;
if
(
getColumnIndexByName
(
pCmd
,
&
pRight
->
colInfo
,
pQueryInfo
,
&
index
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
...
...
@@ -3821,20 +3866,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
// check for like expression
if
((
*
pExpr
)
->
tokenId
==
TK_LIKE
)
{
if
(
pRight
->
value
.
nLen
>
TSDB_PATTERN_STRING_MAX_LEN
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg8
);
}
SSchema
*
pSchema
=
tscGetTableSchema
(
pTableMetaInfo
->
pTableMeta
);
if
((
!
isTablenameToken
(
&
pLeft
->
colInfo
))
&&
pSchema
[
index
.
columnIndex
].
type
!=
TSDB_DATA_TYPE_BINARY
&&
pSchema
[
index
.
columnIndex
].
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
}
// in case of in operator, keep it in a seprate attribute
if
(
index
.
columnIndex
==
TSDB_TBNAME_COLUMN_INDEX
)
{
if
(
!
validTableNameOptr
(
*
pExpr
))
{
...
...
src/client/src/tscUtil.c
浏览文件 @
48c0805f
...
...
@@ -309,7 +309,7 @@ void tscSetResRawPtr(SSqlRes* pRes, SQueryInfo* pQueryInfo) {
int32_t
offset
=
0
;
for
(
int32_t
i
=
0
;
i
<
p
Res
->
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
p
QueryInfo
->
fieldsInfo
.
numOfOutput
;
++
i
)
{
SInternalField
*
pInfo
=
(
SInternalField
*
)
TARRAY_GET_ELEM
(
pQueryInfo
->
fieldsInfo
.
internalField
,
i
);
pRes
->
urow
[
i
]
=
pRes
->
data
+
offset
*
pRes
->
numOfRows
;
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
48c0805f
...
...
@@ -238,9 +238,11 @@ static int32_t dnodeInitStorage() {
}
TDIR
*
tdir
=
tfsOpendir
(
"vnode_bak/.staging"
);
if
(
tfsReaddir
(
tdir
)
!=
NULL
)
{
dError
(
"vnode_bak/.staging dir not empty, fix it first."
);
bool
stagingNotEmpty
=
tfsReaddir
(
tdir
)
!=
NULL
;
tfsClosedir
(
tdir
);
if
(
stagingNotEmpty
)
{
dError
(
"vnode_bak/.staging dir not empty, fix it first."
);
return
-
1
;
}
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
48c0805f
...
...
@@ -222,7 +222,7 @@ static void *dnodeProcessVWriteQueue(void *wparam) {
dnodeSendRpcVWriteRsp
(
pVnode
,
pWrite
,
pWrite
->
code
);
}
else
{
if
(
qtype
==
TAOS_QTYPE_FWD
)
{
vnodeConfirmForward
(
pVnode
,
pWrite
->
pHead
.
version
,
0
,
pWrite
->
pHead
.
msgType
!=
TSDB_MSG_TYPE_SUBMIT
);
vnodeConfirmForward
(
pVnode
,
pWrite
->
pHead
.
version
,
pWrite
->
code
,
pWrite
->
pHead
.
msgType
!=
TSDB_MSG_TYPE_SUBMIT
);
}
if
(
pWrite
->
rspRet
.
rsp
)
{
rpcFreeCont
(
pWrite
->
rspRet
.
rsp
);
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
48c0805f
...
...
@@ -263,7 +263,6 @@ typedef struct SSuperTable_S {
int
lenOfTagOfOneRow
;
char
*
sampleDataBuf
;
int
sampleDataBufSize
;
//int sampleRowCount;
//int sampleUsePos;
...
...
@@ -506,7 +505,7 @@ static int taosRandom()
#endif
static
int
createDatabases
();
static
int
createDatabases
AndStables
();
static
void
createChildTables
();
static
int
queryDbExec
(
TAOS
*
taos
,
char
*
command
,
QUERY_TYPE
type
,
bool
quiet
);
...
...
@@ -2279,7 +2278,7 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName,
}
static
int
createSuperTable
(
TAOS
*
taos
,
char
*
dbName
,
SSuperTable
*
superTbl
s
,
bool
use_metric
)
{
SSuperTable
*
superTbl
)
{
char
command
[
BUFFER_SIZE
]
=
"
\0
"
;
char
cols
[
STRING_LEN
]
=
"
\0
"
;
...
...
@@ -2287,19 +2286,26 @@ static int createSuperTable(TAOS * taos, char* dbName,
int
len
=
0
;
int
lenOfOneRow
=
0
;
for
(
colIndex
=
0
;
colIndex
<
superTbls
->
columnCount
;
colIndex
++
)
{
char
*
dataType
=
superTbls
->
columns
[
colIndex
].
dataType
;
if
(
superTbl
->
columnCount
==
0
)
{
errorPrint
(
"%s() LN%d, super table column count is %d
\n
"
,
__func__
,
__LINE__
,
superTbl
->
columnCount
);
return
-
1
;
}
for
(
colIndex
=
0
;
colIndex
<
superTbl
->
columnCount
;
colIndex
++
)
{
char
*
dataType
=
superTbl
->
columns
[
colIndex
].
dataType
;
if
(
strcasecmp
(
dataType
,
"BINARY"
)
==
0
)
{
len
+=
snprintf
(
cols
+
len
,
STRING_LEN
-
len
,
", col%d %s(%d)"
,
colIndex
,
"BINARY"
,
superTbl
s
->
columns
[
colIndex
].
dataLen
);
lenOfOneRow
+=
superTbl
s
->
columns
[
colIndex
].
dataLen
+
3
;
superTbl
->
columns
[
colIndex
].
dataLen
);
lenOfOneRow
+=
superTbl
->
columns
[
colIndex
].
dataLen
+
3
;
}
else
if
(
strcasecmp
(
dataType
,
"NCHAR"
)
==
0
)
{
len
+=
snprintf
(
cols
+
len
,
STRING_LEN
-
len
,
", col%d %s(%d)"
,
colIndex
,
"NCHAR"
,
superTbl
s
->
columns
[
colIndex
].
dataLen
);
lenOfOneRow
+=
superTbl
s
->
columns
[
colIndex
].
dataLen
+
3
;
superTbl
->
columns
[
colIndex
].
dataLen
);
lenOfOneRow
+=
superTbl
->
columns
[
colIndex
].
dataLen
+
3
;
}
else
if
(
strcasecmp
(
dataType
,
"INT"
)
==
0
)
{
len
+=
snprintf
(
cols
+
len
,
STRING_LEN
-
len
,
", col%d %s"
,
colIndex
,
"INT"
);
lenOfOneRow
+=
11
;
...
...
@@ -2331,92 +2337,99 @@ static int createSuperTable(TAOS * taos, char* dbName,
}
}
superTbl
s
->
lenOfOneRow
=
lenOfOneRow
+
20
;
// timestamp
//printf("%s.%s column count:%d, column length:%d\n\n", g_Dbs.db[i].dbName, g_Dbs.db[i].superTbl
s[j].sTblName, g_Dbs.db[i].superTbls
[j].columnCount, lenOfOneRow);
superTbl
->
lenOfOneRow
=
lenOfOneRow
+
20
;
// timestamp
//printf("%s.%s column count:%d, column length:%d\n\n", g_Dbs.db[i].dbName, g_Dbs.db[i].superTbl
[j].sTblName, g_Dbs.db[i].superTbl
[j].columnCount, lenOfOneRow);
// save for creating child table
superTbls
->
colsOfCreateChildTable
=
(
char
*
)
calloc
(
len
+
20
,
1
);
if
(
NULL
==
superTbls
->
colsOfCreateChildTable
)
{
printf
(
"Failed when calloc, size:%d"
,
len
+
1
);
superTbl
->
colsOfCreateChildTable
=
(
char
*
)
calloc
(
len
+
20
,
1
);
if
(
NULL
==
superTbl
->
colsOfCreateChildTable
)
{
errorPrint
(
"%s() LN%d, Failed when calloc, size:%d"
,
__func__
,
__LINE__
,
len
+
1
);
taos_close
(
taos
);
exit
(
-
1
);
}
snprintf
(
superTbls
->
colsOfCreateChildTable
,
len
+
20
,
"(ts timestamp%s)"
,
cols
);
verbosePrint
(
"%s() LN%d: %s
\n
"
,
__func__
,
__LINE__
,
superTbls
->
colsOfCreateChildTable
);
if
(
use_metric
)
{
snprintf
(
superTbl
->
colsOfCreateChildTable
,
len
+
20
,
"(ts timestamp%s)"
,
cols
);
verbosePrint
(
"%s() LN%d: %s
\n
"
,
__func__
,
__LINE__
,
superTbl
->
colsOfCreateChildTable
);
if
(
superTbl
->
tagCount
==
0
)
{
errorPrint
(
"%s() LN%d, super table tag count is %d
\n
"
,
__func__
,
__LINE__
,
superTbl
->
tagCount
);
return
-
1
;
}
char
tags
[
STRING_LEN
]
=
"
\0
"
;
int
tagIndex
;
len
=
0
;
int
lenOfTagOfOneRow
=
0
;
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"("
);
for
(
tagIndex
=
0
;
tagIndex
<
superTbls
->
tagCount
;
tagIndex
++
)
{
char
*
dataType
=
superTbls
->
tags
[
tagIndex
].
dataType
;
for
(
tagIndex
=
0
;
tagIndex
<
superTbl
->
tagCount
;
tagIndex
++
)
{
char
*
dataType
=
superTbl
->
tags
[
tagIndex
].
dataType
;
if
(
strcasecmp
(
dataType
,
"BINARY"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s(%d), "
,
tagIndex
,
"BINARY"
,
superTbls
->
tags
[
tagIndex
].
dataLen
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
3
;
"BINARY"
,
superTbl
->
tags
[
tagIndex
].
dataLen
);
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
3
;
}
else
if
(
strcasecmp
(
dataType
,
"NCHAR"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s(%d), "
,
tagIndex
,
"NCHAR"
,
superTbls
->
tags
[
tagIndex
].
dataLen
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
3
;
"NCHAR"
,
superTbl
->
tags
[
tagIndex
].
dataLen
);
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
3
;
}
else
if
(
strcasecmp
(
dataType
,
"INT"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"INT"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
11
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
11
;
}
else
if
(
strcasecmp
(
dataType
,
"BIGINT"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"BIGINT"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
21
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
21
;
}
else
if
(
strcasecmp
(
dataType
,
"SMALLINT"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"SMALLINT"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
6
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
6
;
}
else
if
(
strcasecmp
(
dataType
,
"TINYINT"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"TINYINT"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
4
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
4
;
}
else
if
(
strcasecmp
(
dataType
,
"BOOL"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"BOOL"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
6
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
6
;
}
else
if
(
strcasecmp
(
dataType
,
"FLOAT"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"FLOAT"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
22
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
22
;
}
else
if
(
strcasecmp
(
dataType
,
"DOUBLE"
)
==
0
)
{
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
"t%d %s, "
,
tagIndex
,
"DOUBLE"
);
lenOfTagOfOneRow
+=
superTbls
->
tags
[
tagIndex
].
dataLen
+
42
;
lenOfTagOfOneRow
+=
superTbl
->
tags
[
tagIndex
].
dataLen
+
42
;
}
else
{
taos_close
(
taos
);
printf
(
"config error tag type : %s
\n
"
,
dataType
);
exit
(
-
1
);
}
}
len
-=
2
;
len
+=
snprintf
(
tags
+
len
,
STRING_LEN
-
len
,
")"
);
superTbls
->
lenOfTagOfOneRow
=
lenOfTagOfOneRow
;
superTbl
->
lenOfTagOfOneRow
=
lenOfTagOfOneRow
;
snprintf
(
command
,
BUFFER_SIZE
,
"create table if not exists %s.%s (ts timestamp%s) tags %s"
,
dbName
,
superTbls
->
sTblName
,
cols
,
tags
);
dbName
,
superTbl
->
sTblName
,
cols
,
tags
);
verbosePrint
(
"%s() LN%d: %s
\n
"
,
__func__
,
__LINE__
,
command
);
if
(
0
!=
queryDbExec
(
taos
,
command
,
NO_INSERT_TYPE
,
false
))
{
errorPrint
(
"create supertable %s failed!
\n\n
"
,
superTbls
->
sTblName
);
superTbl
->
sTblName
);
return
-
1
;
}
debugPrint
(
"create supertable %s success!
\n\n
"
,
superTbls
->
sTblName
);
}
debugPrint
(
"create supertable %s success!
\n\n
"
,
superTbl
->
sTblName
);
return
0
;
}
static
int
createDatabases
()
{
static
int
createDatabases
AndStables
()
{
TAOS
*
taos
=
NULL
;
int
ret
=
0
;
taos
=
taos_connect
(
g_Dbs
.
host
,
g_Dbs
.
user
,
g_Dbs
.
password
,
NULL
,
g_Dbs
.
port
);
...
...
@@ -2434,7 +2447,6 @@ static int createDatabases() {
taos_close
(
taos
);
return
-
1
;
}
}
int
dataLen
=
0
;
dataLen
+=
snprintf
(
command
+
dataLen
,
...
...
@@ -2510,9 +2522,13 @@ static int createDatabases() {
return
-
1
;
}
printf
(
"
\n
create database %s success!
\n\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
}
debugPrint
(
"%s() %d supertbl count:%d
\n
"
,
__func__
,
__LINE__
,
g_Dbs
.
db
[
i
].
superTblCount
);
int
validStbCount
=
0
;
for
(
int
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
sprintf
(
command
,
"describe %s.%s;"
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
);
...
...
@@ -2522,12 +2538,11 @@ static int createDatabases() {
if
((
ret
!=
0
)
||
(
g_Dbs
.
db
[
i
].
drop
))
{
ret
=
createSuperTable
(
taos
,
g_Dbs
.
db
[
i
].
dbName
,
&
g_Dbs
.
db
[
i
].
superTbls
[
j
]
,
g_Dbs
.
use_metric
);
&
g_Dbs
.
db
[
i
].
superTbls
[
j
]);
if
(
0
!=
ret
)
{
errorPrint
(
"
\n
create super table %d failed!
\n\n
"
,
j
);
taos_close
(
taos
);
return
-
1
;
errorPrint
(
"create super table %d failed!
\n\n
"
,
j
);
continue
;
}
}
...
...
@@ -2536,10 +2551,13 @@ static int createDatabases() {
if
(
0
!=
ret
)
{
errorPrint
(
"
\n
get super table %s.%s info failed!
\n\n
"
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
);
taos_close
(
taos
);
return
-
1
;
continue
;
}
validStbCount
++
;
}
g_Dbs
.
db
[
i
].
superTblCount
=
validStbCount
;
}
taos_close
(
taos
);
...
...
@@ -2724,6 +2742,7 @@ static void createChildTables() {
int
len
;
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
if
(
g_Dbs
.
use_metric
)
{
if
(
g_Dbs
.
db
[
i
].
superTblCount
>
0
)
{
// with super table
for
(
int
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
...
...
@@ -2746,6 +2765,7 @@ static void createChildTables() {
g_Dbs
.
db
[
i
].
superTbls
[
j
].
childTblCount
,
g_Dbs
.
db
[
i
].
dbName
,
&
(
g_Dbs
.
db
[
i
].
superTbls
[
j
]));
}
}
}
else
{
// normal table
len
=
snprintf
(
tblColsBuf
,
MAX_SQL_SIZE
,
"(TS TIMESTAMP"
);
...
...
@@ -3552,19 +3572,6 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
}
cJSON
*
sampleDataBufSize
=
cJSON_GetObjectItem
(
stbInfo
,
"sample_buf_size"
);
if
(
sampleDataBufSize
&&
sampleDataBufSize
->
type
==
cJSON_Number
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleDataBufSize
=
sampleDataBufSize
->
valueint
;
if
(
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleDataBufSize
<
1024
*
1024
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleDataBufSize
=
1024
*
1024
+
1024
;
}
}
else
if
(
!
sampleDataBufSize
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleDataBufSize
=
1024
*
1024
+
1024
;
}
else
{
printf
(
"ERROR: failed to read json, sample_buf_size not found
\n
"
);
goto
PARSE_OVER
;
}
cJSON
*
sampleFormat
=
cJSON_GetObjectItem
(
stbInfo
,
"sample_format"
);
if
(
sampleFormat
&&
sampleFormat
->
type
==
cJSON_String
&&
sampleFormat
->
valuestring
!=
NULL
)
{
...
...
@@ -4682,6 +4689,12 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
for
(
int
i
=
0
;
i
<
batchPerTblTimes
;
i
++
)
{
getTableName
(
tableName
,
pThreadInfo
,
tableSeq
);
if
(
0
==
strlen
(
tableName
))
{
errorPrint
(
"[%d] %s() LN%d, getTableName return null
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
);
return
NULL
;
exit
(
-
1
);
}
int
headLen
;
if
(
i
==
0
)
{
...
...
@@ -4728,7 +4741,7 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
remainderBufLen
-=
dataLen
;
recOfBatch
+=
batchPerTbl
;
startTime
+=
batchPerTbl
*
superTblInfo
->
timeStampStep
;
//
startTime += batchPerTbl * superTblInfo->timeStampStep;
pThreadInfo
->
totalInsertRows
+=
batchPerTbl
;
verbosePrint
(
"[%d] %s() LN%d batchPerTbl=%d recOfBatch=%d
\n
"
,
pThreadInfo
->
threadID
,
__func__
,
__LINE__
,
...
...
@@ -4738,9 +4751,12 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
if
(
insertMode
==
INTERLACE_INSERT_MODE
)
{
if
(
tableSeq
==
pThreadInfo
->
start_table_from
+
pThreadInfo
->
ntables
)
{
// turn to first table
startTime
+=
batchPerTbl
*
superTblInfo
->
timeStampStep
;
tableSeq
=
pThreadInfo
->
start_table_from
;
generatedRecPerTbl
+=
batchPerTbl
;
startTime
=
pThreadInfo
->
start_time
+
generatedRecPerTbl
*
superTblInfo
->
timeStampStep
;
flagSleep
=
true
;
if
(
generatedRecPerTbl
>=
insertRows
)
break
;
...
...
@@ -5137,16 +5153,14 @@ static void startMultiThreadInsertData(int threads, char* db_name,
if
(
superTblInfo
)
{
int
limit
,
offset
;
if
(
superTblInfo
->
childTblOffset
>=
superTblInfo
->
childTblCount
)
{
printf
(
"WARNING: specified offset >= child table count!
\n
"
);
if
(
!
g_args
.
answer_yes
)
{
printf
(
" Press enter key to continue or Ctrl-C to stop
\n\n
"
);
(
void
)
getchar
();
}
if
((
superTblInfo
->
childTblExists
==
TBL_NO_EXISTS
)
&&
((
superTblInfo
->
childTblOffset
!=
0
)
||
(
superTblInfo
->
childTblLimit
!=
0
)))
{
printf
(
"WARNING: offset and limit will not be used since the child tables are not exists!
\n
"
);
}
if
(
superTblInfo
->
childTblOffset
>=
0
)
{
if
(
superTblInfo
->
childTblLimit
<=
0
)
{
if
((
superTblInfo
->
childTblExists
==
TBL_ALREADY_EXISTS
)
&&
(
superTblInfo
->
childTblOffset
>=
0
))
{
if
(
superTblInfo
->
childTblLimit
<
0
)
{
superTblInfo
->
childTblLimit
=
superTblInfo
->
childTblCount
-
superTblInfo
->
childTblOffset
;
}
...
...
@@ -5161,6 +5175,25 @@ static void startMultiThreadInsertData(int threads, char* db_name,
ntables
=
limit
;
startFrom
=
offset
;
if
((
superTblInfo
->
childTblExists
!=
TBL_NO_EXISTS
)
&&
((
superTblInfo
->
childTblOffset
+
superTblInfo
->
childTblLimit
)
>
superTblInfo
->
childTblCount
))
{
printf
(
"WARNING: specified offset + limit > child table count!
\n
"
);
if
(
!
g_args
.
answer_yes
)
{
printf
(
" Press enter key to continue or Ctrl-C to stop
\n\n
"
);
(
void
)
getchar
();
}
}
if
((
superTblInfo
->
childTblExists
!=
TBL_NO_EXISTS
)
&&
(
0
==
superTblInfo
->
childTblLimit
))
{
printf
(
"WARNING: specified limit = 0, which cannot find table name to insert or query!
\n
"
);
if
(
!
g_args
.
answer_yes
)
{
printf
(
" Press enter key to continue or Ctrl-C to stop
\n\n
"
);
(
void
)
getchar
();
}
}
superTblInfo
->
childTblName
=
(
char
*
)
calloc
(
1
,
limit
*
TSDB_TABLE_NAME_LEN
);
if
(
superTblInfo
->
childTblName
==
NULL
)
{
...
...
@@ -5490,7 +5523,7 @@ static int insertTestProcess() {
init_rand_data
();
// create database and super tables
if
(
createDatabases
()
!=
0
)
{
if
(
createDatabases
AndStables
()
!=
0
)
{
fclose
(
g_fpOfInsertResult
);
return
-
1
;
}
...
...
@@ -5518,18 +5551,21 @@ static int insertTestProcess() {
// create sub threads for inserting data
//start = getCurrentTime();
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
if
(
g_Dbs
.
use_metric
)
{
if
(
g_Dbs
.
db
[
i
].
superTblCount
>
0
)
{
for
(
int
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
SSuperTable
*
superTblInfo
=
&
g_Dbs
.
db
[
i
].
superTbls
[
j
];
if
(
0
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
)
{
continue
;
}
if
(
superTblInfo
&&
(
superTblInfo
->
insertRows
>
0
))
{
startMultiThreadInsertData
(
g_Dbs
.
threadCount
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
superTblInfo
);
}
}
}
}
else
{
startMultiThreadInsertData
(
g_Dbs
.
threadCount
,
...
...
src/query/inc/qExecutor.h
浏览文件 @
48c0805f
...
...
@@ -86,7 +86,8 @@ typedef struct SResultRow {
bool
closed
;
// this result status: closed or opened
uint32_t
numOfRows
;
// number of rows of current time window
SResultRowCellInfo
*
pCellInfo
;
// For each result column, there is a resultInfo
union
{
STimeWindow
win
;
char
*
key
;};
// start key of current result row
STimeWindow
win
;
char
*
key
;
// start key of current result row
}
SResultRow
;
typedef
struct
SGroupResInfo
{
...
...
src/query/inc/sql.y
浏览文件 @
48c0805f
...
...
@@ -675,6 +675,7 @@ expr(A) ::= STRING(X). { A = tSqlExprCreateIdValue(&X, TK_STRING);}
expr(A) ::= NOW(X). { A = tSqlExprCreateIdValue(&X, TK_NOW); }
expr(A) ::= VARIABLE(X). { A = tSqlExprCreateIdValue(&X, TK_VARIABLE);}
expr(A) ::= BOOL(X). { A = tSqlExprCreateIdValue(&X, TK_BOOL);}
expr(A) ::= NULL(X). { A = tSqlExprCreateIdValue(&X, TK_NULL);}
// ordinary functions: min(x), max(x), top(k, 20)
expr(A) ::= ID(X) LP exprlist(Y) RP(E). { A = tSqlExprCreateFunction(Y, &X, &E, X.type); }
...
...
src/query/src/qExecutor.c
浏览文件 @
48c0805f
...
...
@@ -200,6 +200,7 @@ static bool isPointInterpoQuery(SQuery *pQuery);
static
void
setResultBufSize
(
SQuery
*
pQuery
,
SRspResultInfo
*
pResultInfo
);
static
void
setCtxTagForJoin
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
SExprInfo
*
pExprInfo
,
void
*
pTable
);
static
void
setParamForStableStddev
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
numOfOutput
,
SExprInfo
*
pExpr
);
static
void
setParamForStableStddevByColData
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
numOfOutput
,
SExprInfo
*
pExpr
,
char
*
val
,
int16_t
bytes
);
static
void
doSetTableGroupOutputBuf
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SResultRowInfo
*
pResultRowInfo
,
SQLFunctionCtx
*
pCtx
,
int32_t
*
rowCellInfoOffset
,
int32_t
numOfOutput
,
int32_t
groupIndex
);
...
...
@@ -1330,6 +1331,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
pInfo
->
colIndex
);
int16_t
bytes
=
pColInfoData
->
info
.
bytes
;
int16_t
type
=
pColInfoData
->
info
.
type
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
if
(
type
==
TSDB_DATA_TYPE_FLOAT
||
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
qError
(
"QInfo:%"
PRIu64
" group by not supported on double/float columns, abort"
,
GET_QID
(
pRuntimeEnv
));
...
...
@@ -1350,6 +1352,10 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn
memcpy
(
pInfo
->
prevData
,
val
,
bytes
);
if
(
pQuery
->
stableQuery
&&
pQuery
->
stabledev
&&
(
pRuntimeEnv
->
prevResult
!=
NULL
))
{
setParamForStableStddevByColData
(
pRuntimeEnv
,
pInfo
->
binfo
.
pCtx
,
pOperator
->
numOfOutput
,
pOperator
->
pExpr
,
val
,
bytes
);
}
int32_t
ret
=
setGroupResultOutputBuf
(
pRuntimeEnv
,
pInfo
,
pOperator
->
numOfOutput
,
val
,
type
,
bytes
,
item
->
groupIndex
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
// null data, too many state code
...
...
@@ -1870,14 +1876,15 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
taosHashCleanup
(
pRuntimeEnv
->
pResultRowHashTable
);
pRuntimeEnv
->
pResultRowHashTable
=
NULL
;
pRuntimeEnv
->
pool
=
destroyResultRowPool
(
pRuntimeEnv
->
pool
);
taosArrayDestroyEx
(
pRuntimeEnv
->
prevResult
,
freeInterResult
);
pRuntimeEnv
->
prevResult
=
NULL
;
taosHashCleanup
(
pRuntimeEnv
->
pTableRetrieveTsMap
);
pRuntimeEnv
->
pTableRetrieveTsMap
=
NULL
;
destroyOperatorInfo
(
pRuntimeEnv
->
proot
);
pRuntimeEnv
->
pool
=
destroyResultRowPool
(
pRuntimeEnv
->
pool
);
taosArrayDestroyEx
(
pRuntimeEnv
->
prevResult
,
freeInterResult
);
pRuntimeEnv
->
prevResult
=
NULL
;
}
static
bool
needBuildResAfterQueryComplete
(
SQInfo
*
pQInfo
)
{
...
...
@@ -3396,6 +3403,42 @@ void setParamForStableStddev(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx* pCtx
}
void
setParamForStableStddevByColData
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
numOfOutput
,
SExprInfo
*
pExpr
,
char
*
val
,
int16_t
bytes
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
int32_t
numOfExprs
=
pQuery
->
numOfOutput
;
for
(
int32_t
i
=
0
;
i
<
numOfExprs
;
++
i
)
{
SExprInfo
*
pExprInfo
=
&
(
pExpr
[
i
]);
if
(
pExprInfo
->
base
.
functionId
!=
TSDB_FUNC_STDDEV_DST
)
{
continue
;
}
SSqlFuncMsg
*
pFuncMsg
=
&
pExprInfo
->
base
;
pCtx
[
i
].
param
[
0
].
arr
=
NULL
;
pCtx
[
i
].
param
[
0
].
nType
=
TSDB_DATA_TYPE_INT
;
// avoid freeing the memory by setting the type to be int
// TODO use hash to speedup this loop
int32_t
numOfGroup
=
(
int32_t
)
taosArrayGetSize
(
pRuntimeEnv
->
prevResult
);
for
(
int32_t
j
=
0
;
j
<
numOfGroup
;
++
j
)
{
SInterResult
*
p
=
taosArrayGet
(
pRuntimeEnv
->
prevResult
,
j
);
if
(
bytes
==
0
||
memcmp
(
p
->
tags
,
val
,
bytes
)
==
0
)
{
int32_t
numOfCols
=
(
int32_t
)
taosArrayGetSize
(
p
->
pResult
);
for
(
int32_t
k
=
0
;
k
<
numOfCols
;
++
k
)
{
SStddevInterResult
*
pres
=
taosArrayGet
(
p
->
pResult
,
k
);
if
(
pres
->
colId
==
pFuncMsg
->
colInfo
.
colId
)
{
pCtx
[
i
].
param
[
0
].
arr
=
pres
->
pResult
;
break
;
}
}
}
}
}
}
/*
* There are two cases to handle:
*
...
...
@@ -6421,6 +6464,9 @@ void freeQInfo(SQInfo *pQInfo) {
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
releaseQueryBuf
(
pRuntimeEnv
->
tableqinfoGroupInfo
.
numOfTables
);
doDestroyTableQueryInfo
(
&
pRuntimeEnv
->
tableqinfoGroupInfo
);
teardownQueryRuntimeEnv
(
&
pQInfo
->
runtimeEnv
);
SQuery
*
pQuery
=
pQInfo
->
runtimeEnv
.
pQuery
;
...
...
@@ -6456,7 +6502,6 @@ void freeQInfo(SQInfo *pQInfo) {
}
}
doDestroyTableQueryInfo
(
&
pRuntimeEnv
->
tableqinfoGroupInfo
);
tfree
(
pQInfo
->
pBuf
);
tfree
(
pQInfo
->
sql
);
...
...
src/query/src/qSqlParser.c
浏览文件 @
48c0805f
...
...
@@ -127,7 +127,12 @@ tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) {
pSqlExpr
->
token
=
*
pToken
;
}
if
(
optrType
==
TK_INTEGER
||
optrType
==
TK_STRING
||
optrType
==
TK_FLOAT
||
optrType
==
TK_BOOL
)
{
if
(
optrType
==
TK_NULL
)
{
pToken
->
type
=
TSDB_DATA_TYPE_NULL
;
tVariantCreate
(
&
pSqlExpr
->
value
,
pToken
);
pSqlExpr
->
tokenId
=
optrType
;
pSqlExpr
->
type
=
SQL_NODE_VALUE
;
}
else
if
(
optrType
==
TK_INTEGER
||
optrType
==
TK_STRING
||
optrType
==
TK_FLOAT
||
optrType
==
TK_BOOL
)
{
toTSDBType
(
pToken
->
type
);
tVariantCreate
(
&
pSqlExpr
->
value
,
pToken
);
...
...
@@ -356,7 +361,11 @@ void tSqlExprCompact(tSqlExpr** pExpr) {
bool
tSqlExprIsLeaf
(
tSqlExpr
*
pExpr
)
{
return
(
pExpr
->
pRight
==
NULL
&&
pExpr
->
pLeft
==
NULL
)
&&
(
pExpr
->
tokenId
==
0
||
pExpr
->
tokenId
==
TK_ID
||
(
pExpr
->
tokenId
>=
TK_BOOL
&&
pExpr
->
tokenId
<=
TK_NCHAR
)
||
pExpr
->
tokenId
==
TK_SET
);
(
pExpr
->
tokenId
==
0
||
(
pExpr
->
tokenId
==
TK_ID
)
||
(
pExpr
->
tokenId
>=
TK_BOOL
&&
pExpr
->
tokenId
<=
TK_NCHAR
)
||
(
pExpr
->
tokenId
==
TK_NULL
)
||
(
pExpr
->
tokenId
==
TK_SET
));
}
bool
tSqlExprIsParentOfLeaf
(
tSqlExpr
*
pExpr
)
{
...
...
src/query/src/qUtil.c
浏览文件 @
48c0805f
...
...
@@ -66,8 +66,8 @@ void cleanupResultRowInfo(SResultRowInfo *pResultRowInfo) {
return
;
}
if
(
pResultRowInfo
->
type
==
TSDB_DATA_TYPE_BINARY
||
pResultRowInfo
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
for
(
int32_t
i
=
0
;
i
<
pResultRowInfo
->
size
;
++
i
)
{
if
(
pResultRowInfo
->
pResult
[
i
])
{
tfree
(
pResultRowInfo
->
pResult
[
i
]
->
key
);
}
}
...
...
@@ -153,11 +153,8 @@ void clearResultRow(SQueryRuntimeEnv *pRuntimeEnv, SResultRow *pResultRow, int16
pResultRow
->
offset
=
-
1
;
pResultRow
->
closed
=
false
;
if
(
type
==
TSDB_DATA_TYPE_BINARY
||
type
==
TSDB_DATA_TYPE_NCHAR
)
{
tfree
(
pResultRow
->
key
);
}
else
{
pResultRow
->
win
=
TSWINDOW_INITIALIZER
;
}
}
// TODO refactor: use macro
...
...
src/query/src/queryMain.c
浏览文件 @
48c0805f
...
...
@@ -372,6 +372,7 @@ int32_t qKillQuery(qinfo_t qinfo) {
return
TSDB_CODE_QRY_INVALID_QHANDLE
;
}
qDebug
(
"QInfo:%"
PRIu64
" query killed"
,
pQInfo
->
qId
);
setQueryKilled
(
pQInfo
);
// Wait for the query executing thread being stopped/
...
...
src/query/src/sql.c
浏览文件 @
48c0805f
...
...
@@ -129,16 +129,16 @@ typedef union {
#define ParseARG_STORE yypParser->pInfo = pInfo
#define YYFALLBACK 1
#define YYNSTATE 315
#define YYNRULE 26
6
#define YYNRULE 26
7
#define YYNTOKEN 187
#define YY_MAX_SHIFT 314
#define YY_MIN_SHIFTREDUCE 50
5
#define YY_MAX_SHIFTREDUCE 77
0
#define YY_ERROR_ACTION 77
1
#define YY_ACCEPT_ACTION 77
2
#define YY_NO_ACTION 77
3
#define YY_MIN_REDUCE 77
4
#define YY_MAX_REDUCE 10
39
#define YY_MIN_SHIFTREDUCE 50
6
#define YY_MAX_SHIFTREDUCE 77
2
#define YY_ERROR_ACTION 77
3
#define YY_ACCEPT_ACTION 77
4
#define YY_NO_ACTION 77
5
#define YY_MIN_REDUCE 77
6
#define YY_MAX_REDUCE 10
42
/************* End control #defines *******************************************/
/* Define the yytestcase() macro to be a no-op if is not already defined
...
...
@@ -204,146 +204,146 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (6
79
)
#define YY_ACTTAB_COUNT (6
80
)
static
const
YYACTIONTYPE
yy_action
[]
=
{
/* 0 */
133
,
55
2
,
202
,
312
,
206
,
140
,
941
,
17
,
85
,
553
,
/* 10 */
77
2
,
314
,
179
,
47
,
48
,
140
,
51
,
52
,
30
,
181
,
/* 20 */
214
,
41
,
181
,
50
,
262
,
55
,
53
,
57
,
54
,
102
0
,
/* 30 */
92
0
,
209
,
1021
,
46
,
45
,
185
,
181
,
44
,
43
,
42
,
/* 40 */
47
,
48
,
9
08
,
51
,
52
,
208
,
1021
,
214
,
41
,
552
,
/* 50 */
50
,
262
,
55
,
53
,
57
,
54
,
93
2
,
553
,
1017
,
203
,
/* 60 */
46
,
45
,
91
7
,
247
,
44
,
43
,
42
,
48
,
938
,
51
,
/* 70 */
52
,
242
,
97
2
,
214
,
41
,
552
,
50
,
262
,
55
,
53
,
/* 80 */
57
,
54
,
97
3
,
553
,
257
,
278
,
46
,
45
,
29
8
,
225
,
/* 90 */
44
,
43
,
42
,
50
6
,
507
,
508
,
509
,
510
,
511
,
512
,
/* 100 */
51
3
,
514
,
515
,
516
,
517
,
518
,
313
,
631
,
1016
,
231
,
/* 110 */
70
,
552
,
30
,
47
,
48
,
1015
,
51
,
52
,
819
,
553
,
/* 120 */
214
,
41
,
166
,
50
,
262
,
55
,
53
,
57
,
54
,
44
,
/* 130 */
43
,
42
,
717
,
46
,
45
,
288
,
287
,
44
,
43
,
42
,
/* 140 */
47
,
49
,
198
,
51
,
52
,
140
,
140
,
214
,
41
,
234
,
/* 150 */
50
,
262
,
55
,
53
,
57
,
54
,
916
,
238
,
237
,
227
,
/* 0 */
133
,
55
3
,
202
,
312
,
206
,
140
,
943
,
226
,
140
,
554
,
/* 10 */
77
4
,
314
,
17
,
47
,
48
,
140
,
51
,
52
,
30
,
181
,
/* 20 */
214
,
41
,
181
,
50
,
262
,
55
,
53
,
57
,
54
,
102
3
,
/* 30 */
92
2
,
209
,
1024
,
46
,
45
,
179
,
181
,
44
,
43
,
42
,
/* 40 */
47
,
48
,
9
20
,
51
,
52
,
208
,
1024
,
214
,
41
,
553
,
/* 50 */
50
,
262
,
55
,
53
,
57
,
54
,
93
4
,
554
,
185
,
203
,
/* 60 */
46
,
45
,
91
9
,
247
,
44
,
43
,
42
,
48
,
940
,
51
,
/* 70 */
52
,
242
,
97
4
,
214
,
41
,
79
,
50
,
262
,
55
,
53
,
/* 80 */
57
,
54
,
97
5
,
632
,
257
,
30
,
46
,
45
,
27
8
,
225
,
/* 90 */
44
,
43
,
42
,
50
7
,
508
,
509
,
510
,
511
,
512
,
513
,
/* 100 */
51
4
,
515
,
516
,
517
,
518
,
519
,
313
,
553
,
85
,
231
,
/* 110 */
70
,
288
,
287
,
47
,
48
,
554
,
51
,
52
,
298
,
219
,
/* 120 */
214
,
41
,
553
,
50
,
262
,
55
,
53
,
57
,
54
,
918
,
/* 130 */
554
,
105
,
718
,
46
,
45
,
1020
,
298
,
44
,
43
,
42
,
/* 140 */
47
,
49
,
910
,
51
,
52
,
922
,
140
,
214
,
41
,
234
,
/* 150 */
50
,
262
,
55
,
53
,
57
,
54
,
1019
,
238
,
237
,
227
,
/* 160 */
46
,
45
,
285
,
284
,
44
,
43
,
42
,
23
,
276
,
307
,
/* 170 */
306
,
275
,
274
,
273
,
305
,
272
,
304
,
303
,
302
,
271
,
/* 180 */
301
,
300
,
88
0
,
30
,
868
,
869
,
870
,
871
,
872
,
873
,
/* 190 */
87
4
,
875
,
876
,
877
,
878
,
879
,
881
,
882
,
51
,
52
,
/* 200 */
18
,
30
,
214
,
41
,
90
6
,
50
,
262
,
55
,
53
,
57
,
/* 210 */
54
,
259
,
79
,
78
,
25
,
46
,
45
,
190
,
199
,
44
,
/* 220 */
43
,
42
,
82
,
191
,
217
,
28
,
30
,
917
,
268
,
118
,
/* 230 */
117
,
189
,
12
,
213
,
730
,
932
,
84
,
721
,
81
,
724
,
/* 240 */
74
,
727
,
218
,
213
,
730
,
917
,
80
,
721
,
36
,
72
4
,
/* 250 */
204
,
727
,
30
,
903
,
904
,
29
,
907
,
46
,
45
,
71
,
/* 260 */
74
,
44
,
43
,
42
,
223
,
210
,
211
,
281
,
36
,
261
,
/* 270 */
917
,
23
,
914
,
307
,
306
,
210
,
211
,
723
,
305
,
726
,
/* 280 */
304
,
303
,
302
,
278
,
301
,
300
,
311
,
310
,
126
,
677
,
/* 290 */
241
,
888
,
68
,
282
,
886
,
887
,
917
,
245
,
197
,
889
,
/* 300 */
2
19
,
891
,
892
,
890
,
670
,
893
,
894
,
55
,
53
,
57
,
/* 310 */
54
,
1
,
154
,
263
,
220
,
46
,
45
,
30
,
221
,
44
,
/* 320 */
43
,
42
,
105
,
103
,
108
,
308
,
920
,
298
,
69
,
97
,
/* 330 */
1
07
,
113
,
116
,
106
,
224
,
655
,
56
,
280
,
652
,
11
0
,
/* 340 */
653
,
226
,
654
,
30
,
920
,
667
,
56
,
5
,
156
,
729
,
/* 350 */
1
83
,
920
,
24
,
33
,
155
,
92
,
87
,
91
,
286
,
72
9
,
/* 360 */
905
,
917
,
174
,
170
,
719
,
728
,
228
,
229
,
172
,
169
,
/* 370 */
1
21
,
120
,
119
,
828
,
820
,
728
,
918
,
166
,
166
,
3
,
/* 380 */
167
,
243
,
674
,
212
,
290
,
31
,
683
,
917
,
698
,
699
,
/* 390 */
135
,
689
,
690
,
750
,
731
,
60
,
20
,
19
,
19
,
722
,
/* 400 */
7
20
,
725
,
61
,
64
,
641
,
184
,
265
,
643
,
31
,
733
,
/* 410 */
31
,
60
,
267
,
642
,
115
,
114
,
83
,
60
,
96
,
95
,
/* 420 */
186
,
14
,
13
,
65
,
62
,
180
,
187
,
6
,
102
,
101
,
/* 430 */
67
,
188
,
630
,
16
,
15
,
659
,
657
,
660
,
658
,
131
,
/* 440 */
129
,
194
,
195
,
193
,
656
,
178
,
192
,
182
,
1031
,
919
,
/* 450 */
983
,
239
,
982
,
215
,
979
,
978
,
216
,
289
,
39
,
13
2
,
/* 460 */
940
,
948
,
950
,
130
,
134
,
933
,
138
,
246
,
965
,
964
,
/* 470 */
151
,
915
,
150
,
682
,
248
,
913
,
205
,
299
,
104
,
884
,
/* 480 */
1
60
,
260
,
152
,
153
,
145
,
143
,
141
,
831
,
270
,
66
,
/* 490 */
250
,
930
,
63
,
255
,
37
,
176
,
34
,
279
,
58
,
142
,
/* 500 */
827
,
1036
,
93
,
1035
,
1033
,
157
,
283
,
1030
,
99
,
1029
,
/* 510 */
1027
,
158
,
849
,
35
,
258
,
32
,
38
,
256
,
177
,
816
,
/* 520 */
109
,
814
,
111
,
112
,
254
,
812
,
811
,
230
,
168
,
252
,
/* 530 */
809
,
808
,
807
,
806
,
805
,
804
,
171
,
173
,
801
,
799
,
/* 540 */
797
,
795
,
793
,
175
,
249
,
244
,
72
,
75
,
40
,
251
,
/* 550 */
966
,
291
,
292
,
293
,
294
,
295
,
296
,
297
,
309
,
200
,
/* 560 */
2
22
,
770
,
269
,
232
,
233
,
769
,
235
,
201
,
196
,
88
,
/* 570 */
89
,
236
,
768
,
756
,
755
,
240
,
245
,
8
,
810
,
662
,
/* 580 */
122
,
161
,
123
,
165
,
163
,
803
,
850
,
159
,
162
,
164
,
/* 590 */
1
24
,
802
,
73
,
125
,
794
,
4
,
2
,
264
,
76
,
684
,
/* 600 */
1
36
,
137
,
687
,
77
,
144
,
148
,
146
,
147
,
149
,
896
,
/* 610 */
207
,
253
,
26
,
691
,
139
,
27
,
9
,
732
,
10
,
7
,
/* 620 */
734
,
11
,
21
,
266
,
22
,
86
,
594
,
84
,
590
,
588
,
/* 630 */
58
7
,
586
,
583
,
556
,
277
,
31
,
59
,
90
,
633
,
94
,
/* 640 */
63
2
,
629
,
578
,
98
,
100
,
576
,
568
,
574
,
570
,
572
,
/* 650 */
5
66
,
564
,
597
,
596
,
595
,
593
,
592
,
591
,
589
,
585
,
/* 660 */
5
84
,
60
,
554
,
522
,
520
,
774
,
773
,
773
,
773
,
773
,
/* 670 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
127
,
128
,
/* 180 */
301
,
300
,
88
2
,
30
,
870
,
871
,
872
,
873
,
874
,
875
,
/* 190 */
87
6
,
877
,
878
,
879
,
880
,
881
,
883
,
884
,
51
,
52
,
/* 200 */
821
,
1018
,
214
,
41
,
16
6
,
50
,
262
,
55
,
53
,
57
,
/* 210 */
54
,
259
,
18
,
78
,
82
,
46
,
45
,
198
,
223
,
44
,
/* 220 */
43
,
42
,
213
,
731
,
217
,
25
,
722
,
919
,
725
,
190
,
/* 230 */
728
,
221
,
213
,
731
,
199
,
191
,
722
,
724
,
725
,
727
,
/* 240 */
728
,
118
,
117
,
189
,
263
,
905
,
906
,
29
,
909
,
4
4
,
/* 250 */
43
,
42
,
30
,
74
,
210
,
211
,
308
,
922
,
261
,
30
,
/* 260 */
23
,
36
,
307
,
306
,
210
,
211
,
934
,
305
,
30
,
304
,
/* 270 */
303
,
302
,
74
,
301
,
300
,
890
,
908
,
183
,
888
,
889
,
/* 280 */
36
,
204
,
922
,
891
,
916
,
893
,
894
,
892
,
224
,
895
,
/* 290 */
896
,
280
,
656
,
218
,
830
,
653
,
919
,
654
,
166
,
655
,
/* 300 */
2
81
,
69
,
241
,
919
,
68
,
55
,
53
,
57
,
54
,
282
,
/* 310 */
197
,
671
,
919
,
46
,
45
,
30
,
822
,
44
,
43
,
42
,
/* 320 */
166
,
103
,
108
,
228
,
229
,
56
,
220
,
97
,
107
,
113
,
/* 330 */
1
16
,
106
,
732
,
907
,
723
,
56
,
726
,
110
,
730
,
3
0
,
/* 340 */
735
,
12
,
732
,
5
,
156
,
84
,
184
,
81
,
730
,
33
,
/* 350 */
1
55
,
92
,
87
,
91
,
729
,
278
,
286
,
1
,
154
,
91
9
,
/* 360 */
174
,
170
,
186
,
212
,
729
,
80
,
172
,
169
,
121
,
120
,
/* 370 */
1
19
,
46
,
45
,
3
,
167
,
44
,
43
,
42
,
71
,
720
,
/* 380 */
290
,
699
,
700
,
919
,
311
,
310
,
126
,
243
,
668
,
675
,
/* 390 */
678
,
31
,
684
,
690
,
180
,
24
,
135
,
60
,
245
,
691
,
/* 400 */
7
52
,
657
,
733
,
20
,
19
,
61
,
19
,
6
,
64
,
642
,
/* 410 */
265
,
1034
,
644
,
31
,
31
,
721
,
60
,
267
,
643
,
187
,
/* 420 */
28
,
83
,
60
,
268
,
96
,
95
,
188
,
62
,
65
,
14
,
/* 430 */
13
,
102
,
101
,
660
,
67
,
661
,
631
,
194
,
16
,
15
,
/* 440 */
658
,
195
,
659
,
115
,
114
,
131
,
129
,
193
,
178
,
192
,
/* 450 */
182
,
921
,
985
,
984
,
215
,
981
,
239
,
980
,
132
,
94
2
,
/* 460 */
216
,
289
,
39
,
950
,
952
,
967
,
134
,
966
,
138
,
935
,
/* 470 */
246
,
130
,
248
,
917
,
151
,
915
,
150
,
205
,
683
,
250
,
/* 480 */
1
52
,
886
,
299
,
153
,
291
,
148
,
146
,
260
,
142
,
932
,
/* 490 */
141
,
58
,
833
,
270
,
66
,
255
,
143
,
37
,
63
,
176
,
/* 500 */
34
,
279
,
829
,
258
,
144
,
1039
,
93
,
256
,
1038
,
1036
,
/* 510 */
157
,
254
,
283
,
1033
,
99
,
1032
,
1030
,
158
,
851
,
35
,
/* 520 */
252
,
145
,
32
,
38
,
177
,
818
,
109
,
816
,
111
,
40
,
/* 530 */
112
,
814
,
813
,
230
,
168
,
811
,
810
,
809
,
808
,
807
,
/* 540 */
806
,
171
,
173
,
803
,
801
,
799
,
797
,
795
,
175
,
249
,
/* 550 */
244
,
72
,
75
,
104
,
251
,
968
,
292
,
293
,
294
,
295
,
/* 560 */
2
96
,
297
,
309
,
200
,
222
,
269
,
772
,
232
,
201
,
233
,
/* 570 */
771
,
88
,
89
,
196
,
235
,
236
,
770
,
758
,
757
,
240
,
/* 580 */
245
,
8
,
264
,
73
,
812
,
663
,
805
,
161
,
852
,
159
,
/* 590 */
1
60
,
163
,
162
,
164
,
165
,
122
,
123
,
124
,
804
,
76
,
/* 600 */
1
25
,
796
,
4
,
2
,
685
,
136
,
137
,
688
,
77
,
149
,
/* 610 */
147
,
207
,
253
,
86
,
692
,
898
,
139
,
9
,
10
,
26
,
/* 620 */
27
,
734
,
7
,
11
,
736
,
21
,
22
,
266
,
595
,
591
,
/* 630 */
58
9
,
84
,
588
,
587
,
584
,
557
,
277
,
94
,
90
,
31
,
/* 640 */
63
4
,
633
,
59
,
630
,
579
,
577
,
98
,
569
,
575
,
571
,
/* 650 */
5
73
,
567
,
565
,
100
,
598
,
597
,
596
,
594
,
593
,
592
,
/* 660 */
5
90
,
586
,
585
,
60
,
555
,
523
,
521
,
776
,
775
,
127
,
/* 670 */
77
5
,
775
,
775
,
775
,
775
,
775
,
775
,
775
,
775
,
128
,
};
static
const
YYCODETYPE
yy_lookahead
[]
=
{
/* 0 */
191
,
1
,
190
,
191
,
210
,
191
,
191
,
252
,
197
,
9
,
/* 0 */
191
,
1
,
190
,
191
,
210
,
191
,
191
,
191
,
191
,
9
,
/* 10 */
188
,
189
,
252
,
13
,
14
,
191
,
16
,
17
,
191
,
252
,
/* 20 */
20
,
21
,
252
,
23
,
24
,
25
,
26
,
27
,
28
,
262
,
/* 30 */
236
,
261
,
262
,
33
,
34
,
252
,
252
,
37
,
38
,
39
,
/* 40 */
13
,
14
,
2
31
,
16
,
17
,
261
,
262
,
20
,
21
,
1
,
/* 40 */
13
,
14
,
2
26
,
16
,
17
,
261
,
262
,
20
,
21
,
1
,
/* 50 */
23
,
24
,
25
,
26
,
27
,
28
,
234
,
9
,
252
,
232
,
/* 60 */
33
,
34
,
235
,
254
,
37
,
38
,
39
,
14
,
253
,
16
,
/* 70 */
17
,
249
,
258
,
20
,
21
,
1
,
23
,
24
,
25
,
26
,
/* 80 */
27
,
28
,
258
,
9
,
260
,
79
,
33
,
34
,
81
,
67
,
/* 70 */
17
,
249
,
258
,
20
,
21
,
258
,
23
,
24
,
25
,
26
,
/* 80 */
27
,
28
,
258
,
5
,
260
,
191
,
33
,
34
,
79
,
67
,
/* 90 */
37
,
38
,
39
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
/* 100 */
52
,
53
,
54
,
55
,
56
,
57
,
58
,
5
,
252
,
61
,
/* 110 */
110
,
1
,
191
,
13
,
14
,
252
,
16
,
17
,
196
,
9
,
/* 120 */
20
,
21
,
200
,
23
,
24
,
25
,
26
,
27
,
28
,
37
,
/* 130 */
38
,
39
,
105
,
33
,
34
,
33
,
34
,
37
,
38
,
39
,
/* 140 */
13
,
14
,
2
52
,
16
,
17
,
191
,
191
,
20
,
21
,
135
,
/* 150 */
23
,
24
,
25
,
26
,
27
,
28
,
2
35
,
143
,
144
,
137
,
/* 100 */
52
,
53
,
54
,
55
,
56
,
57
,
58
,
1
,
197
,
61
,
/* 110 */
110
,
33
,
34
,
13
,
14
,
9
,
16
,
17
,
81
,
210
,
/* 120 */
20
,
21
,
1
,
23
,
24
,
25
,
26
,
27
,
28
,
235
,
/* 130 */
9
,
76
,
105
,
33
,
34
,
252
,
81
,
37
,
38
,
39
,
/* 140 */
13
,
14
,
2
31
,
16
,
17
,
236
,
191
,
20
,
21
,
135
,
/* 150 */
23
,
24
,
25
,
26
,
27
,
28
,
2
52
,
143
,
144
,
137
,
/* 160 */
33
,
34
,
140
,
141
,
37
,
38
,
39
,
88
,
89
,
90
,
/* 170 */
91
,
92
,
93
,
94
,
95
,
96
,
97
,
98
,
99
,
100
,
/* 180 */
101
,
102
,
209
,
191
,
211
,
212
,
213
,
214
,
215
,
216
,
/* 190 */
217
,
218
,
219
,
220
,
221
,
222
,
223
,
224
,
16
,
17
,
/* 200 */
44
,
191
,
20
,
21
,
0
,
23
,
24
,
25
,
26
,
27
,
/* 210 */
28
,
256
,
258
,
258
,
104
,
33
,
34
,
61
,
252
,
37
,
/* 220 */
38
,
39
,
197
,
67
,
232
,
104
,
191
,
235
,
107
,
73
,
/* 230 */
74
,
75
,
104
,
1
,
2
,
234
,
108
,
5
,
110
,
7
,
/* 240 */
104
,
9
,
232
,
1
,
2
,
235
,
237
,
5
,
112
,
7
,
/* 250 */
249
,
9
,
191
,
228
,
229
,
230
,
231
,
33
,
34
,
250
,
/* 260 */
104
,
37
,
38
,
39
,
67
,
33
,
34
,
232
,
112
,
3
7
,
/* 270 */
235
,
88
,
191
,
90
,
91
,
33
,
34
,
5
,
95
,
7
,
/* 280 */
97
,
98
,
99
,
79
,
101
,
102
,
64
,
65
,
66
,
105
,
/* 290 */
134
,
209
,
136
,
232
,
212
,
213
,
235
,
113
,
142
,
217
,
/* 300 */
2
10
,
219
,
220
,
221
,
37
,
223
,
224
,
25
,
26
,
27
,
/* 310 */
28
,
198
,
199
,
15
,
233
,
33
,
34
,
191
,
210
,
37
,
/* 320 */
38
,
39
,
76
,
62
,
63
,
210
,
236
,
81
,
197
,
68
,
/* 330 */
69
,
70
,
71
,
72
,
137
,
2
,
104
,
140
,
5
,
78
,
/* 340 */
7
,
191
,
9
,
191
,
236
,
109
,
104
,
62
,
63
,
117
,
/* 350 */
252
,
236
,
116
,
68
,
69
,
70
,
71
,
72
,
232
,
117
,
/* 360 */
229
,
235
,
62
,
63
,
1
,
133
,
33
,
34
,
68
,
69
,
/* 370 */
7
0
,
71
,
72
,
196
,
196
,
133
,
226
,
200
,
200
,
194
,
/* 380 */
195
,
105
,
115
,
60
,
232
,
109
,
105
,
235
,
124
,
12
5
,
/* 390 */
10
9
,
105
,
105
,
105
,
105
,
109
,
109
,
109
,
109
,
5
,
/* 400 */
37
,
7
,
109
,
109
,
105
,
252
,
105
,
105
,
109
,
111
,
/* 410 */
10
9
,
109
,
105
,
105
,
76
,
77
,
109
,
109
,
138
,
139
,
/* 420 */
252
,
138
,
139
,
129
,
131
,
252
,
252
,
104
,
138
,
139
,
/* 430 */
1
04
,
252
,
106
,
138
,
139
,
5
,
5
,
7
,
7
,
62
,
/* 440 */
63
,
252
,
252
,
252
,
111
,
252
,
252
,
252
,
236
,
236
,
/* 450 */
2
27
,
191
,
227
,
227
,
227
,
227
,
227
,
227
,
25
1
,
191
,
/* 460 */
191
,
191
,
191
,
60
,
191
,
234
,
191
,
234
,
259
,
259
,
/* 470 */
191
,
234
,
238
,
117
,
255
,
191
,
255
,
103
,
87
,
22
5
,
/* 480 */
206
,
122
,
191
,
191
,
243
,
245
,
247
,
191
,
191
,
12
8
,
/* 490 */
2
55
,
248
,
130
,
255
,
191
,
191
,
191
,
191
,
127
,
246
,
/* 500 */
191
,
191
,
191
,
1
91
,
191
,
191
,
191
,
19
1
,
191
,
191
,
/* 510 */
191
,
1
91
,
191
,
191
,
126
,
191
,
191
,
12
1
,
191
,
191
,
/* 520 */
1
91
,
191
,
191
,
191
,
120
,
191
,
191
,
191
,
191
,
119
,
/* 200 */
196
,
252
,
20
,
21
,
20
0
,
23
,
24
,
25
,
26
,
27
,
/* 210 */
28
,
256
,
44
,
258
,
197
,
33
,
34
,
252
,
67
,
37
,
/* 220 */
38
,
39
,
1
,
2
,
232
,
104
,
5
,
235
,
7
,
61
,
/* 230 */
9
,
210
,
1
,
2
,
252
,
67
,
5
,
5
,
7
,
7
,
/* 240 */
9
,
73
,
74
,
75
,
15
,
228
,
229
,
230
,
231
,
3
7
,
/* 250 */
38
,
39
,
191
,
104
,
33
,
34
,
210
,
236
,
37
,
191
,
/* 260 */
88
,
112
,
90
,
91
,
33
,
34
,
234
,
95
,
191
,
9
7
,
/* 270 */
98
,
99
,
104
,
101
,
102
,
209
,
0
,
252
,
212
,
213
,
/* 280 */
112
,
249
,
236
,
217
,
191
,
219
,
220
,
221
,
137
,
223
,
/* 290 */
224
,
140
,
2
,
232
,
196
,
5
,
235
,
7
,
200
,
9
,
/* 300 */
2
32
,
197
,
134
,
235
,
136
,
25
,
26
,
27
,
28
,
232
,
/* 310 */
142
,
37
,
235
,
33
,
34
,
191
,
196
,
37
,
38
,
39
,
/* 320 */
200
,
62
,
63
,
33
,
34
,
104
,
233
,
68
,
69
,
70
,
/* 330 */
71
,
72
,
111
,
229
,
5
,
104
,
7
,
78
,
117
,
191
,
/* 340 */
111
,
104
,
111
,
62
,
63
,
108
,
252
,
110
,
117
,
68
,
/* 350 */
69
,
70
,
71
,
72
,
133
,
79
,
232
,
198
,
199
,
235
,
/* 360 */
62
,
63
,
252
,
60
,
133
,
237
,
68
,
69
,
70
,
71
,
/* 370 */
7
2
,
33
,
34
,
194
,
195
,
37
,
38
,
39
,
250
,
1
,
/* 380 */
232
,
124
,
125
,
235
,
64
,
65
,
66
,
105
,
109
,
11
5
,
/* 390 */
10
5
,
109
,
105
,
105
,
252
,
116
,
109
,
109
,
113
,
10
5
,
/* 400 */
105
,
111
,
105
,
109
,
109
,
109
,
109
,
104
,
109
,
105
,
/* 410 */
10
5
,
236
,
105
,
109
,
109
,
37
,
109
,
105
,
105
,
252
,
/* 420 */
104
,
109
,
109
,
107
,
138
,
139
,
252
,
131
,
129
,
138
,
/* 430 */
1
39
,
138
,
139
,
5
,
104
,
7
,
106
,
252
,
138
,
139
,
/* 440 */
5
,
252
,
7
,
76
,
77
,
62
,
63
,
252
,
252
,
252
,
/* 450 */
2
52
,
236
,
227
,
227
,
227
,
227
,
191
,
227
,
19
1
,
191
,
/* 460 */
227
,
227
,
251
,
191
,
191
,
259
,
191
,
259
,
191
,
234
,
/* 470 */
234
,
60
,
255
,
234
,
191
,
191
,
238
,
255
,
117
,
25
5
,
/* 480 */
191
,
225
,
103
,
191
,
86
,
240
,
242
,
122
,
246
,
24
8
,
/* 490 */
2
47
,
127
,
191
,
191
,
128
,
255
,
245
,
191
,
130
,
191
,
/* 500 */
191
,
191
,
191
,
1
26
,
244
,
191
,
191
,
12
1
,
191
,
191
,
/* 510 */
191
,
1
20
,
191
,
191
,
191
,
191
,
191
,
19
1
,
191
,
191
,
/* 520 */
1
19
,
243
,
191
,
191
,
191
,
191
,
191
,
191
,
191
,
132
,
/* 530 */
191
,
191
,
191
,
191
,
191
,
191
,
191
,
191
,
191
,
191
,
/* 540 */
191
,
191
,
191
,
191
,
1
18
,
192
,
192
,
192
,
132
,
192
,
/* 550 */
192
,
86
,
50
,
83
,
85
,
54
,
84
,
82
,
79
,
192
,
/* 560 */
192
,
5
,
192
,
145
,
5
,
5
,
145
,
192
,
192
,
197
,
/* 570 */
197
,
5
,
5
,
90
,
89
,
135
,
113
,
104
,
192
,
10
5
,
/* 580 */
1
93
,
202
,
193
,
201
,
203
,
192
,
208
,
207
,
205
,
204
,
/* 590 */
193
,
192
,
114
,
193
,
192
,
194
,
198
,
107
,
109
,
105
,
/* 600 */
1
04
,
109
,
105
,
104
,
244
,
240
,
242
,
241
,
239
,
225
,
/* 610 */
1
,
104
,
109
,
105
,
104
,
109
,
123
,
105
,
123
,
104
,
/* 620 */
1
11
,
104
,
104
,
107
,
104
,
76
,
9
,
108
,
5
,
5
,
/* 630 */
5
,
5
,
5
,
80
,
15
,
109
,
16
,
76
,
5
,
13
9
,
/* 640 */
5
,
105
,
5
,
139
,
139
,
5
,
5
,
5
,
5
,
5
,
/* 650 */
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
/* 660 */
5
,
109
,
80
,
60
,
59
,
0
,
263
,
263
,
263
,
263
,
/* 670 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
21
,
21
,
263
,
/* 540 */
191
,
191
,
191
,
191
,
1
91
,
191
,
191
,
191
,
191
,
118
,
/* 550 */
192
,
192
,
192
,
87
,
192
,
192
,
50
,
83
,
85
,
54
,
/* 560 */
84
,
82
,
79
,
192
,
192
,
192
,
5
,
145
,
192
,
5
,
/* 570 */
5
,
197
,
197
,
192
,
145
,
5
,
5
,
90
,
89
,
13
5
,
/* 580 */
1
13
,
104
,
107
,
114
,
192
,
105
,
192
,
202
,
208
,
207
,
/* 590 */
206
,
203
,
205
,
204
,
201
,
193
,
193
,
193
,
192
,
109
,
/* 600 */
1
93
,
192
,
194
,
198
,
105
,
104
,
109
,
105
,
104
,
239
,
/* 610 */
241
,
1
,
104
,
76
,
105
,
225
,
104
,
123
,
123
,
109
,
/* 620 */
1
09
,
105
,
104
,
104
,
111
,
104
,
104
,
107
,
9
,
5
,
/* 630 */
5
,
108
,
5
,
5
,
5
,
80
,
15
,
139
,
76
,
10
9
,
/* 640 */
5
,
5
,
16
,
105
,
5
,
5
,
139
,
5
,
5
,
5
,
/* 650 */
5
,
5
,
5
,
139
,
5
,
5
,
5
,
5
,
5
,
5
,
/* 660 */
5
,
5
,
5
,
109
,
80
,
60
,
59
,
0
,
263
,
21
,
/* 670 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
21
,
/* 680 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
/* 690 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
/* 700 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
...
...
@@ -362,101 +362,101 @@ static const YYCODETYPE yy_lookahead[] = {
/* 830 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
/* 840 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
/* 850 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
263
,
/* 860 */
263
,
263
,
263
,
263
,
263
,
263
,
/* 860 */
263
,
263
,
263
,
263
,
263
,
263
,
263
,
};
#define YY_SHIFT_COUNT (314)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (66
5
)
#define YY_SHIFT_MAX (66
7
)
static
const
unsigned
short
int
yy_shift_ofst
[]
=
{
/* 0 */
1
56
,
79
,
79
,
183
,
183
,
6
,
232
,
242
,
74
,
74
,
/* 10 */
74
,
74
,
74
,
74
,
74
,
74
,
74
,
0
,
48
,
242
,
/* 20 */
333
,
333
,
333
,
333
,
110
,
136
,
74
,
74
,
74
,
204
,
/* 30 */
74
,
74
,
246
,
6
,
7
,
7
,
679
,
679
,
679
,
242
,
/* 40 */
2
42
,
242
,
242
,
242
,
242
,
242
,
242
,
242
,
242
,
242
,
/* 50 */
2
42
,
242
,
242
,
242
,
242
,
242
,
242
,
242
,
242
,
333
,
/* 60 */
333
,
102
,
102
,
102
,
102
,
102
,
102
,
102
,
74
,
74
,
/* 70 */
74
,
267
,
74
,
136
,
136
,
74
,
74
,
74
,
264
,
264
,
/* 80 */
2
36
,
136
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
/* 90 */
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
/* 100 */
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
/* 110 */
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
/* 120 */
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
74
,
/* 130 */
74
,
74
,
403
,
403
,
403
,
356
,
356
,
356
,
403
,
356
,
/* 140 */
4
03
,
361
,
362
,
371
,
359
,
388
,
396
,
404
,
410
,
426
,
/* 150 */
416
,
403
,
403
,
403
,
374
,
6
,
6
,
403
,
403
,
391
,
/* 160 */
465
,
502
,
470
,
469
,
501
,
472
,
475
,
374
,
403
,
479
,
/* 170 */
4
79
,
403
,
479
,
403
,
479
,
403
,
679
,
679
,
27
,
100
,
/* 180 */
127
,
100
,
100
,
53
,
182
,
28
2
,
282
,
282
,
282
,
261
,
/* 190 */
28
5
,
300
,
224
,
224
,
224
,
224
,
22
,
14
,
92
,
9
2
,
/* 200 */
128
,
197
,
222
,
276
,
184
,
281
,
286
,
287
,
288
,
289
,
/* 210 */
2
72
,
394
,
363
,
323
,
298
,
293
,
294
,
299
,
301
,
302
,
/* 220 */
3
07
,
308
,
121
,
280
,
283
,
290
,
326
,
295
,
430
,
431
,
/* 230 */
3
38
,
377
,
556
,
418
,
559
,
560
,
421
,
566
,
567
,
483
,
/* 240 */
48
5
,
440
,
463
,
490
,
473
,
478
,
474
,
489
,
494
,
496
,
/* 250 */
497
,
492
,
499
,
609
,
507
,
508
,
510
,
503
,
493
,
506
,
/* 260 */
495
,
51
2
,
515
,
509
,
517
,
490
,
518
,
516
,
520
,
519
,
/* 270 */
5
49
,
617
,
623
,
624
,
625
,
626
,
627
,
553
,
619
,
561
,
/* 280 */
500
,
526
,
526
,
620
,
504
,
505
,
526
,
633
,
635
,
536
,
/* 290 */
5
26
,
637
,
640
,
641
,
642
,
643
,
644
,
645
,
646
,
647
,
/* 300 */
6
48
,
649
,
650
,
651
,
652
,
653
,
654
,
655
,
552
,
582
,
/* 310 */
6
56
,
657
,
603
,
605
,
665
,
/* 0 */
1
68
,
79
,
79
,
172
,
172
,
9
,
221
,
231
,
106
,
106
,
/* 10 */
106
,
106
,
106
,
106
,
106
,
106
,
106
,
0
,
48
,
231
,
/* 20 */
290
,
290
,
290
,
290
,
121
,
149
,
106
,
106
,
106
,
276
,
/* 30 */
106
,
106
,
55
,
9
,
37
,
37
,
680
,
680
,
680
,
231
,
/* 40 */
2
31
,
231
,
231
,
231
,
231
,
231
,
231
,
231
,
231
,
231
,
/* 50 */
2
31
,
231
,
231
,
231
,
231
,
231
,
231
,
231
,
231
,
290
,
/* 60 */
290
,
78
,
78
,
78
,
78
,
78
,
78
,
78
,
106
,
106
,
/* 70 */
106
,
274
,
106
,
149
,
149
,
106
,
106
,
106
,
257
,
257
,
/* 80 */
2
79
,
149
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
/* 90 */
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
/* 100 */
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
/* 110 */
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
/* 120 */
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
106
,
/* 130 */
106
,
106
,
411
,
411
,
411
,
361
,
361
,
361
,
411
,
361
,
/* 140 */
4
11
,
366
,
368
,
364
,
365
,
377
,
386
,
391
,
401
,
431
,
/* 150 */
397
,
411
,
411
,
411
,
379
,
9
,
9
,
411
,
411
,
466
,
/* 160 */
398
,
506
,
474
,
473
,
505
,
476
,
479
,
379
,
411
,
483
,
/* 170 */
4
83
,
411
,
483
,
411
,
483
,
411
,
680
,
680
,
27
,
100
,
/* 180 */
127
,
100
,
100
,
53
,
182
,
28
0
,
280
,
280
,
280
,
259
,
/* 190 */
28
1
,
298
,
338
,
338
,
338
,
338
,
22
,
14
,
212
,
21
2
,
/* 200 */
237
,
151
,
320
,
282
,
285
,
287
,
288
,
294
,
295
,
297
,
/* 210 */
2
32
,
329
,
378
,
303
,
229
,
296
,
299
,
304
,
305
,
307
,
/* 220 */
3
12
,
313
,
316
,
286
,
291
,
293
,
330
,
300
,
428
,
435
,
/* 230 */
3
67
,
383
,
561
,
422
,
564
,
565
,
429
,
570
,
571
,
487
,
/* 240 */
48
9
,
444
,
467
,
475
,
477
,
469
,
480
,
490
,
499
,
501
,
/* 250 */
502
,
497
,
504
,
610
,
508
,
509
,
512
,
510
,
494
,
511
,
/* 260 */
495
,
51
6
,
518
,
513
,
519
,
475
,
521
,
520
,
522
,
523
,
/* 270 */
5
37
,
619
,
624
,
625
,
627
,
628
,
629
,
555
,
621
,
562
,
/* 280 */
498
,
530
,
530
,
626
,
507
,
514
,
530
,
635
,
636
,
538
,
/* 290 */
5
30
,
639
,
640
,
642
,
643
,
644
,
645
,
646
,
647
,
649
,
/* 300 */
6
50
,
651
,
652
,
653
,
654
,
655
,
656
,
657
,
554
,
584
,
/* 310 */
6
48
,
658
,
605
,
607
,
667
,
};
#define YY_REDUCE_COUNT (177)
#define YY_REDUCE_MIN (-24
5
)
#define YY_REDUCE_MAX (40
2
)
#define YY_REDUCE_MIN (-24
0
)
#define YY_REDUCE_MAX (40
9
)
static
const
short
yy_reduce_ofst
[]
=
{
/* 0 */
-
178
,
-
27
,
-
27
,
82
,
82
,
25
,
-
230
,
-
216
,
-
173
,
-
176
,
/* 10 */
-
45
,
-
8
,
10
,
35
,
61
,
126
,
152
,
-
185
,
-
188
,
-
233
,
/* 20 */
-
206
,
90
,
108
,
115
,
-
191
,
1
,
-
186
,
-
46
,
81
,
-
1
89
,
/* 30 */
150
,
-
79
,
-
78
,
131
,
177
,
178
,
9
,
113
,
185
,
-
245
,
/* 40 */
-
2
40
,
-
217
,
-
194
,
-
144
,
-
137
,
-
110
,
-
34
,
98
,
153
,
168
,
/* 50 */
1
73
,
174
,
179
,
189
,
190
,
191
,
193
,
194
,
195
,
212
,
/* 60 */
21
3
,
223
,
225
,
226
,
227
,
228
,
229
,
230
,
260
,
268
,
/* 70 */
26
9
,
207
,
270
,
231
,
233
,
271
,
273
,
275
,
209
,
210
,
/* 80 */
23
4
,
237
,
279
,
284
,
291
,
292
,
296
,
297
,
303
,
304
,
/* 90 */
30
5
,
306
,
309
,
310
,
311
,
312
,
313
,
314
,
315
,
316
,
/* 100 */
3
17
,
318
,
319
,
320
,
321
,
322
,
324
,
325
,
327
,
328
,
/* 110 */
3
29
,
330
,
331
,
332
,
334
,
335
,
336
,
337
,
339
,
340
,
/* 120 */
34
1
,
342
,
343
,
344
,
345
,
346
,
347
,
348
,
349
,
350
,
/* 130 */
35
1
,
352
,
353
,
354
,
355
,
219
,
221
,
235
,
357
,
238
,
/* 140 */
3
58
,
243
,
239
,
253
,
240
,
360
,
241
,
364
,
366
,
36
5
,
/* 150 */
3
69
,
367
,
368
,
370
,
254
,
372
,
373
,
375
,
376
,
378
,
/* 160 */
38
0
,
274
,
379
,
383
,
381
,
385
,
382
,
384
,
386
,
387
,
/* 170 */
389
,
393
,
397
,
399
,
400
,
402
,
398
,
401
,
/* 0 */
-
178
,
-
27
,
-
27
,
66
,
66
,
17
,
-
230
,
-
216
,
-
173
,
-
176
,
/* 10 */
-
45
,
-
8
,
61
,
68
,
77
,
124
,
148
,
-
185
,
-
188
,
-
233
,
/* 20 */
-
206
,
-
91
,
21
,
46
,
-
191
,
32
,
-
186
,
-
183
,
93
,
-
89
,
/* 30 */
-
184
,
-
106
,
4
,
104
,
98
,
120
,
128
,
159
,
179
,
-
240
,
/* 40 */
-
2
17
,
-
194
,
-
117
,
-
96
,
-
51
,
-
35
,
-
18
,
25
,
94
,
110
,
/* 50 */
1
42
,
167
,
174
,
185
,
189
,
195
,
196
,
197
,
198
,
175
,
/* 60 */
21
5
,
225
,
226
,
227
,
228
,
230
,
233
,
234
,
265
,
267
,
/* 70 */
26
8
,
211
,
272
,
235
,
236
,
273
,
275
,
277
,
206
,
208
,
/* 80 */
23
8
,
239
,
283
,
284
,
289
,
292
,
301
,
302
,
306
,
308
,
/* 90 */
30
9
,
310
,
311
,
314
,
315
,
317
,
318
,
319
,
321
,
322
,
/* 100 */
3
23
,
324
,
325
,
326
,
327
,
328
,
331
,
332
,
333
,
334
,
/* 110 */
3
35
,
336
,
337
,
339
,
340
,
341
,
342
,
343
,
344
,
345
,
/* 120 */
34
6
,
347
,
348
,
349
,
350
,
351
,
352
,
353
,
354
,
355
,
/* 130 */
35
6
,
357
,
358
,
359
,
360
,
217
,
222
,
224
,
362
,
240
,
/* 140 */
3
63
,
241
,
243
,
242
,
251
,
260
,
278
,
244
,
369
,
24
5
,
/* 150 */
3
70
,
371
,
372
,
373
,
256
,
374
,
375
,
376
,
381
,
380
,
/* 160 */
38
2
,
384
,
385
,
387
,
388
,
389
,
393
,
390
,
392
,
402
,
/* 170 */
403
,
394
,
404
,
406
,
407
,
409
,
405
,
408
,
};
static
const
YYACTIONTYPE
yy_default
[]
=
{
/* 0 */
77
1
,
883
,
829
,
895
,
817
,
826
,
1023
,
1023
,
771
,
771
,
/* 10 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
942
,
790
,
1023
,
/* 20 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
826
,
/* 30 */
77
1
,
771
,
832
,
826
,
832
,
832
,
937
,
867
,
885
,
771
,
/* 40 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 50 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 60 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 70 */
77
1
,
944
,
947
,
771
,
771
,
949
,
771
,
771
,
969
,
969
,
/* 80 */
93
5
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 90 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 100 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
815
,
/* 110 */
77
1
,
813
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 120 */
77
1
,
771
,
771
,
771
,
771
,
771
,
800
,
771
,
771
,
771
,
/* 130 */
77
1
,
771
,
792
,
792
,
792
,
771
,
771
,
771
,
792
,
771
,
/* 140 */
79
2
,
976
,
980
,
974
,
962
,
970
,
961
,
957
,
955
,
954
,
/* 150 */
98
4
,
792
,
792
,
792
,
830
,
826
,
826
,
792
,
792
,
848
,
/* 160 */
84
6
,
844
,
836
,
842
,
838
,
840
,
834
,
818
,
792
,
824
,
/* 170 */
82
4
,
792
,
824
,
792
,
824
,
792
,
867
,
885
,
771
,
985
,
/* 180 */
77
1
,
1022
,
975
,
1012
,
1011
,
1018
,
1010
,
1009
,
1008
,
771
,
/* 190 */
77
1
,
771
,
1004
,
1005
,
1007
,
1006
,
771
,
771
,
1014
,
1013
,
/* 200 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 210 */
77
1
,
771
,
771
,
987
,
771
,
981
,
977
,
771
,
771
,
771
,
/* 220 */
77
1
,
771
,
771
,
771
,
771
,
771
,
897
,
771
,
771
,
771
,
/* 230 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 240 */
77
1
,
771
,
934
,
771
,
771
,
771
,
771
,
945
,
771
,
771
,
/* 250 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
971
,
771
,
963
,
/* 260 */
77
1
,
771
,
771
,
771
,
771
,
909
,
771
,
771
,
771
,
771
,
/* 270 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 280 */
77
1
,
1034
,
1032
,
771
,
771
,
771
,
1028
,
771
,
771
,
771
,
/* 290 */
102
6
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
/* 300 */
77
1
,
771
,
771
,
771
,
771
,
771
,
771
,
771
,
851
,
771
,
/* 310 */
798
,
796
,
771
,
788
,
771
,
/* 0 */
77
3
,
885
,
831
,
897
,
819
,
828
,
1026
,
1026
,
773
,
773
,
/* 10 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
944
,
792
,
1026
,
/* 20 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
828
,
/* 30 */
77
3
,
773
,
834
,
828
,
834
,
834
,
939
,
869
,
887
,
773
,
/* 40 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 50 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 60 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 70 */
77
3
,
946
,
949
,
773
,
773
,
951
,
773
,
773
,
971
,
971
,
/* 80 */
93
7
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 90 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 100 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
817
,
/* 110 */
77
3
,
815
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 120 */
77
3
,
773
,
773
,
773
,
773
,
773
,
802
,
773
,
773
,
773
,
/* 130 */
77
3
,
773
,
794
,
794
,
794
,
773
,
773
,
773
,
794
,
773
,
/* 140 */
79
4
,
978
,
982
,
976
,
964
,
972
,
963
,
959
,
957
,
956
,
/* 150 */
98
6
,
794
,
794
,
794
,
832
,
828
,
828
,
794
,
794
,
850
,
/* 160 */
84
8
,
846
,
838
,
844
,
840
,
842
,
836
,
820
,
794
,
826
,
/* 170 */
82
6
,
794
,
826
,
794
,
826
,
794
,
869
,
887
,
773
,
987
,
/* 180 */
77
3
,
1025
,
977
,
1015
,
1014
,
1021
,
1013
,
1012
,
1011
,
773
,
/* 190 */
77
3
,
773
,
1007
,
1008
,
1010
,
1009
,
773
,
773
,
1017
,
1016
,
/* 200 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 210 */
77
3
,
773
,
773
,
989
,
773
,
983
,
979
,
773
,
773
,
773
,
/* 220 */
77
3
,
773
,
773
,
773
,
773
,
773
,
899
,
773
,
773
,
773
,
/* 230 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 240 */
77
3
,
773
,
936
,
773
,
773
,
773
,
773
,
947
,
773
,
773
,
/* 250 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
973
,
773
,
965
,
/* 260 */
77
3
,
773
,
773
,
773
,
773
,
911
,
773
,
773
,
773
,
773
,
/* 270 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 280 */
77
3
,
1037
,
1035
,
773
,
773
,
773
,
1031
,
773
,
773
,
773
,
/* 290 */
102
9
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
/* 300 */
77
3
,
773
,
773
,
773
,
773
,
773
,
773
,
773
,
853
,
773
,
/* 310 */
800
,
798
,
773
,
790
,
773
,
};
/********** End of lemon-generated parsing tables *****************************/
...
...
@@ -1245,46 +1245,47 @@ static const char *const yyRuleName[] = {
/* 223 */
"expr ::= NOW"
,
/* 224 */
"expr ::= VARIABLE"
,
/* 225 */
"expr ::= BOOL"
,
/* 226 */
"expr ::= ID LP exprlist RP"
,
/* 227 */
"expr ::= ID LP STAR RP"
,
/* 228 */
"expr ::= expr IS NULL"
,
/* 229 */
"expr ::= expr IS NOT NULL"
,
/* 230 */
"expr ::= expr LT expr"
,
/* 231 */
"expr ::= expr GT expr"
,
/* 232 */
"expr ::= expr LE expr"
,
/* 233 */
"expr ::= expr GE expr"
,
/* 234 */
"expr ::= expr NE expr"
,
/* 235 */
"expr ::= expr EQ expr"
,
/* 236 */
"expr ::= expr BETWEEN expr AND expr"
,
/* 237 */
"expr ::= expr AND expr"
,
/* 238 */
"expr ::= expr OR expr"
,
/* 239 */
"expr ::= expr PLUS expr"
,
/* 240 */
"expr ::= expr MINUS expr"
,
/* 241 */
"expr ::= expr STAR expr"
,
/* 242 */
"expr ::= expr SLASH expr"
,
/* 243 */
"expr ::= expr REM expr"
,
/* 244 */
"expr ::= expr LIKE expr"
,
/* 245 */
"expr ::= expr IN LP exprlist RP"
,
/* 246 */
"exprlist ::= exprlist COMMA expritem"
,
/* 247 */
"exprlist ::= expritem"
,
/* 248 */
"expritem ::= expr"
,
/* 249 */
"expritem ::="
,
/* 250 */
"cmd ::= RESET QUERY CACHE"
,
/* 251 */
"cmd ::= SYNCDB ids REPLICA"
,
/* 252 */
"cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist"
,
/* 253 */
"cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids"
,
/* 254 */
"cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist"
,
/* 255 */
"cmd ::= ALTER TABLE ids cpxName DROP TAG ids"
,
/* 256 */
"cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids"
,
/* 257 */
"cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem"
,
/* 258 */
"cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist"
,
/* 259 */
"cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids"
,
/* 260 */
"cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist"
,
/* 261 */
"cmd ::= ALTER STABLE ids cpxName DROP TAG ids"
,
/* 262 */
"cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids"
,
/* 263 */
"cmd ::= KILL CONNECTION INTEGER"
,
/* 264 */
"cmd ::= KILL STREAM INTEGER COLON INTEGER"
,
/* 265 */
"cmd ::= KILL QUERY INTEGER COLON INTEGER"
,
/* 226 */
"expr ::= NULL"
,
/* 227 */
"expr ::= ID LP exprlist RP"
,
/* 228 */
"expr ::= ID LP STAR RP"
,
/* 229 */
"expr ::= expr IS NULL"
,
/* 230 */
"expr ::= expr IS NOT NULL"
,
/* 231 */
"expr ::= expr LT expr"
,
/* 232 */
"expr ::= expr GT expr"
,
/* 233 */
"expr ::= expr LE expr"
,
/* 234 */
"expr ::= expr GE expr"
,
/* 235 */
"expr ::= expr NE expr"
,
/* 236 */
"expr ::= expr EQ expr"
,
/* 237 */
"expr ::= expr BETWEEN expr AND expr"
,
/* 238 */
"expr ::= expr AND expr"
,
/* 239 */
"expr ::= expr OR expr"
,
/* 240 */
"expr ::= expr PLUS expr"
,
/* 241 */
"expr ::= expr MINUS expr"
,
/* 242 */
"expr ::= expr STAR expr"
,
/* 243 */
"expr ::= expr SLASH expr"
,
/* 244 */
"expr ::= expr REM expr"
,
/* 245 */
"expr ::= expr LIKE expr"
,
/* 246 */
"expr ::= expr IN LP exprlist RP"
,
/* 247 */
"exprlist ::= exprlist COMMA expritem"
,
/* 248 */
"exprlist ::= expritem"
,
/* 249 */
"expritem ::= expr"
,
/* 250 */
"expritem ::="
,
/* 251 */
"cmd ::= RESET QUERY CACHE"
,
/* 252 */
"cmd ::= SYNCDB ids REPLICA"
,
/* 253 */
"cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist"
,
/* 254 */
"cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids"
,
/* 255 */
"cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist"
,
/* 256 */
"cmd ::= ALTER TABLE ids cpxName DROP TAG ids"
,
/* 257 */
"cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids"
,
/* 258 */
"cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem"
,
/* 259 */
"cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist"
,
/* 260 */
"cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids"
,
/* 261 */
"cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist"
,
/* 262 */
"cmd ::= ALTER STABLE ids cpxName DROP TAG ids"
,
/* 263 */
"cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids"
,
/* 264 */
"cmd ::= KILL CONNECTION INTEGER"
,
/* 265 */
"cmd ::= KILL STREAM INTEGER COLON INTEGER"
,
/* 266 */
"cmd ::= KILL QUERY INTEGER COLON INTEGER"
,
};
#endif
/* NDEBUG */
...
...
@@ -1970,46 +1971,47 @@ static const struct {
{
252
,
-
1
},
/* (223) expr ::= NOW */
{
252
,
-
1
},
/* (224) expr ::= VARIABLE */
{
252
,
-
1
},
/* (225) expr ::= BOOL */
{
252
,
-
4
},
/* (226) expr ::= ID LP exprlist RP */
{
252
,
-
4
},
/* (227) expr ::= ID LP STAR RP */
{
252
,
-
3
},
/* (228) expr ::= expr IS NULL */
{
252
,
-
4
},
/* (229) expr ::= expr IS NOT NULL */
{
252
,
-
3
},
/* (230) expr ::= expr LT expr */
{
252
,
-
3
},
/* (231) expr ::= expr GT expr */
{
252
,
-
3
},
/* (232) expr ::= expr LE expr */
{
252
,
-
3
},
/* (233) expr ::= expr GE expr */
{
252
,
-
3
},
/* (234) expr ::= expr NE expr */
{
252
,
-
3
},
/* (235) expr ::= expr EQ expr */
{
252
,
-
5
},
/* (236) expr ::= expr BETWEEN expr AND expr */
{
252
,
-
3
},
/* (237) expr ::= expr AND expr */
{
252
,
-
3
},
/* (238) expr ::= expr OR expr */
{
252
,
-
3
},
/* (239) expr ::= expr PLUS expr */
{
252
,
-
3
},
/* (240) expr ::= expr MINUS expr */
{
252
,
-
3
},
/* (241) expr ::= expr STAR expr */
{
252
,
-
3
},
/* (242) expr ::= expr SLASH expr */
{
252
,
-
3
},
/* (243) expr ::= expr REM expr */
{
252
,
-
3
},
/* (244) expr ::= expr LIKE expr */
{
252
,
-
5
},
/* (245) expr ::= expr IN LP exprlist RP */
{
261
,
-
3
},
/* (246) exprlist ::= exprlist COMMA expritem */
{
261
,
-
1
},
/* (247) exprlist ::= expritem */
{
262
,
-
1
},
/* (248) expritem ::= expr */
{
262
,
0
},
/* (249) expritem ::= */
{
189
,
-
3
},
/* (250) cmd ::= RESET QUERY CACHE */
{
189
,
-
3
},
/* (251) cmd ::= SYNCDB ids REPLICA */
{
189
,
-
7
},
/* (252) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
189
,
-
7
},
/* (253) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
189
,
-
7
},
/* (254) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
189
,
-
7
},
/* (255) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
189
,
-
8
},
/* (256) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
189
,
-
9
},
/* (257) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
189
,
-
7
},
/* (258) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
189
,
-
7
},
/* (259) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
189
,
-
7
},
/* (260) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
189
,
-
7
},
/* (261) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
189
,
-
8
},
/* (262) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
189
,
-
3
},
/* (263) cmd ::= KILL CONNECTION INTEGER */
{
189
,
-
5
},
/* (264) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{
189
,
-
5
},
/* (265) cmd ::= KILL QUERY INTEGER COLON INTEGER */
{
252
,
-
1
},
/* (226) expr ::= NULL */
{
252
,
-
4
},
/* (227) expr ::= ID LP exprlist RP */
{
252
,
-
4
},
/* (228) expr ::= ID LP STAR RP */
{
252
,
-
3
},
/* (229) expr ::= expr IS NULL */
{
252
,
-
4
},
/* (230) expr ::= expr IS NOT NULL */
{
252
,
-
3
},
/* (231) expr ::= expr LT expr */
{
252
,
-
3
},
/* (232) expr ::= expr GT expr */
{
252
,
-
3
},
/* (233) expr ::= expr LE expr */
{
252
,
-
3
},
/* (234) expr ::= expr GE expr */
{
252
,
-
3
},
/* (235) expr ::= expr NE expr */
{
252
,
-
3
},
/* (236) expr ::= expr EQ expr */
{
252
,
-
5
},
/* (237) expr ::= expr BETWEEN expr AND expr */
{
252
,
-
3
},
/* (238) expr ::= expr AND expr */
{
252
,
-
3
},
/* (239) expr ::= expr OR expr */
{
252
,
-
3
},
/* (240) expr ::= expr PLUS expr */
{
252
,
-
3
},
/* (241) expr ::= expr MINUS expr */
{
252
,
-
3
},
/* (242) expr ::= expr STAR expr */
{
252
,
-
3
},
/* (243) expr ::= expr SLASH expr */
{
252
,
-
3
},
/* (244) expr ::= expr REM expr */
{
252
,
-
3
},
/* (245) expr ::= expr LIKE expr */
{
252
,
-
5
},
/* (246) expr ::= expr IN LP exprlist RP */
{
261
,
-
3
},
/* (247) exprlist ::= exprlist COMMA expritem */
{
261
,
-
1
},
/* (248) exprlist ::= expritem */
{
262
,
-
1
},
/* (249) expritem ::= expr */
{
262
,
0
},
/* (250) expritem ::= */
{
189
,
-
3
},
/* (251) cmd ::= RESET QUERY CACHE */
{
189
,
-
3
},
/* (252) cmd ::= SYNCDB ids REPLICA */
{
189
,
-
7
},
/* (253) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
189
,
-
7
},
/* (254) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
189
,
-
7
},
/* (255) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
189
,
-
7
},
/* (256) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
189
,
-
8
},
/* (257) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
189
,
-
9
},
/* (258) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
189
,
-
7
},
/* (259) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
189
,
-
7
},
/* (260) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
189
,
-
7
},
/* (261) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
189
,
-
7
},
/* (262) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
189
,
-
8
},
/* (263) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
189
,
-
3
},
/* (264) cmd ::= KILL CONNECTION INTEGER */
{
189
,
-
5
},
/* (265) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{
189
,
-
5
},
/* (266) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
static
void
yy_accept
(
yyParser
*
);
/* Forward Declaration */
...
...
@@ -2794,7 +2796,7 @@ static void yy_reduce(
break
;
case
200
:
/* having_opt ::= */
case
210
:
/* where_opt ::= */
yytestcase
(
yyruleno
==
210
);
case
2
49
:
/* expritem ::= */
yytestcase
(
yyruleno
==
249
);
case
2
50
:
/* expritem ::= */
yytestcase
(
yyruleno
==
250
);
{
yymsp
[
1
].
minor
.
yy118
=
0
;}
break
;
case
201
:
/* having_opt ::= HAVING expr */
...
...
@@ -2871,112 +2873,116 @@ static void yy_reduce(
{
yylhsminor
.
yy118
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_BOOL
);}
yymsp
[
0
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
226
:
/* expr ::= ID LP exprlist RP */
case
226
:
/* expr ::= NULL */
{
yylhsminor
.
yy118
=
tSqlExprCreateIdValue
(
&
yymsp
[
0
].
minor
.
yy0
,
TK_NULL
);}
yymsp
[
0
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
227
:
/* expr ::= ID LP exprlist RP */
{
yylhsminor
.
yy118
=
tSqlExprCreateFunction
(
yymsp
[
-
1
].
minor
.
yy159
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
yymsp
[
-
3
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
22
7
:
/* expr ::= ID LP STAR RP */
case
22
8
:
/* expr ::= ID LP STAR RP */
{
yylhsminor
.
yy118
=
tSqlExprCreateFunction
(
NULL
,
&
yymsp
[
-
3
].
minor
.
yy0
,
&
yymsp
[
0
].
minor
.
yy0
,
yymsp
[
-
3
].
minor
.
yy0
.
type
);
}
yymsp
[
-
3
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
22
8
:
/* expr ::= expr IS NULL */
case
22
9
:
/* expr ::= expr IS NULL */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
NULL
,
TK_ISNULL
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
2
29
:
/* expr ::= expr IS NOT NULL */
case
2
30
:
/* expr ::= expr IS NOT NULL */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
3
].
minor
.
yy118
,
NULL
,
TK_NOTNULL
);}
yymsp
[
-
3
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
0
:
/* expr ::= expr LT expr */
case
23
1
:
/* expr ::= expr LT expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_LT
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
1
:
/* expr ::= expr GT expr */
case
23
2
:
/* expr ::= expr GT expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_GT
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
2
:
/* expr ::= expr LE expr */
case
23
3
:
/* expr ::= expr LE expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_LE
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
3
:
/* expr ::= expr GE expr */
case
23
4
:
/* expr ::= expr GE expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_GE
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
4
:
/* expr ::= expr NE expr */
case
23
5
:
/* expr ::= expr NE expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_NE
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
5
:
/* expr ::= expr EQ expr */
case
23
6
:
/* expr ::= expr EQ expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_EQ
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
6
:
/* expr ::= expr BETWEEN expr AND expr */
case
23
7
:
/* expr ::= expr BETWEEN expr AND expr */
{
tSqlExpr
*
X2
=
tSqlExprClone
(
yymsp
[
-
4
].
minor
.
yy118
);
yylhsminor
.
yy118
=
tSqlExprCreate
(
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy118
,
yymsp
[
-
2
].
minor
.
yy118
,
TK_GE
),
tSqlExprCreate
(
X2
,
yymsp
[
0
].
minor
.
yy118
,
TK_LE
),
TK_AND
);}
yymsp
[
-
4
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
7
:
/* expr ::= expr AND expr */
case
23
8
:
/* expr ::= expr AND expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_AND
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
23
8
:
/* expr ::= expr OR expr */
case
23
9
:
/* expr ::= expr OR expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_OR
);
}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
2
39
:
/* expr ::= expr PLUS expr */
case
2
40
:
/* expr ::= expr PLUS expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_PLUS
);
}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
0
:
/* expr ::= expr MINUS expr */
case
24
1
:
/* expr ::= expr MINUS expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_MINUS
);
}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
1
:
/* expr ::= expr STAR expr */
case
24
2
:
/* expr ::= expr STAR expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_STAR
);
}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
2
:
/* expr ::= expr SLASH expr */
case
24
3
:
/* expr ::= expr SLASH expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_DIVIDE
);}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
3
:
/* expr ::= expr REM expr */
case
24
4
:
/* expr ::= expr REM expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_REM
);
}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
4
:
/* expr ::= expr LIKE expr */
case
24
5
:
/* expr ::= expr LIKE expr */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
2
].
minor
.
yy118
,
yymsp
[
0
].
minor
.
yy118
,
TK_LIKE
);
}
yymsp
[
-
2
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
5
:
/* expr ::= expr IN LP exprlist RP */
case
24
6
:
/* expr ::= expr IN LP exprlist RP */
{
yylhsminor
.
yy118
=
tSqlExprCreate
(
yymsp
[
-
4
].
minor
.
yy118
,
(
tSqlExpr
*
)
yymsp
[
-
1
].
minor
.
yy159
,
TK_IN
);
}
yymsp
[
-
4
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
24
6
:
/* exprlist ::= exprlist COMMA expritem */
case
24
7
:
/* exprlist ::= exprlist COMMA expritem */
{
yylhsminor
.
yy159
=
tSqlExprListAppend
(
yymsp
[
-
2
].
minor
.
yy159
,
yymsp
[
0
].
minor
.
yy118
,
0
,
0
);}
yymsp
[
-
2
].
minor
.
yy159
=
yylhsminor
.
yy159
;
break
;
case
24
7
:
/* exprlist ::= expritem */
case
24
8
:
/* exprlist ::= expritem */
{
yylhsminor
.
yy159
=
tSqlExprListAppend
(
0
,
yymsp
[
0
].
minor
.
yy118
,
0
,
0
);}
yymsp
[
0
].
minor
.
yy159
=
yylhsminor
.
yy159
;
break
;
case
24
8
:
/* expritem ::= expr */
case
24
9
:
/* expritem ::= expr */
{
yylhsminor
.
yy118
=
yymsp
[
0
].
minor
.
yy118
;}
yymsp
[
0
].
minor
.
yy118
=
yylhsminor
.
yy118
;
break
;
case
25
0
:
/* cmd ::= RESET QUERY CACHE */
case
25
1
:
/* cmd ::= RESET QUERY CACHE */
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_RESET_CACHE
,
0
);}
break
;
case
25
1
:
/* cmd ::= SYNCDB ids REPLICA */
case
25
2
:
/* cmd ::= SYNCDB ids REPLICA */
{
setDCLSqlElems
(
pInfo
,
TSDB_SQL_SYNC_DB_REPLICA
,
1
,
&
yymsp
[
-
1
].
minor
.
yy0
);}
break
;
case
25
2
:
/* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
case
25
3
:
/* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy159
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
25
3
:
/* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
case
25
4
:
/* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -2987,14 +2993,14 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
25
4
:
/* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
case
25
5
:
/* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy159
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
-
1
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
25
5
:
/* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
case
25
6
:
/* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -3005,7 +3011,7 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
25
6
:
/* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
case
25
7
:
/* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
yymsp
[
-
5
].
minor
.
yy0
.
n
+=
yymsp
[
-
4
].
minor
.
yy0
.
n
;
...
...
@@ -3019,7 +3025,7 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
25
7
:
/* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
case
25
8
:
/* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp
[
-
6
].
minor
.
yy0
.
n
+=
yymsp
[
-
5
].
minor
.
yy0
.
n
;
...
...
@@ -3031,14 +3037,14 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
25
8
:
/* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
case
25
9
:
/* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy159
,
NULL
,
TSDB_ALTER_TABLE_ADD_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
2
59
:
/* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
case
2
60
:
/* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -3049,14 +3055,14 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
0
:
/* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
case
26
1
:
/* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
SAlterTableInfo
*
pAlterTable
=
tSetAlterTableInfo
(
&
yymsp
[
-
4
].
minor
.
yy0
,
yymsp
[
0
].
minor
.
yy159
,
NULL
,
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
,
TSDB_SUPER_TABLE
);
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
1
:
/* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
case
26
2
:
/* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
yymsp
[
-
4
].
minor
.
yy0
.
n
+=
yymsp
[
-
3
].
minor
.
yy0
.
n
;
...
...
@@ -3067,7 +3073,7 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
2
:
/* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
case
26
3
:
/* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
yymsp
[
-
5
].
minor
.
yy0
.
n
+=
yymsp
[
-
4
].
minor
.
yy0
.
n
;
...
...
@@ -3081,13 +3087,13 @@ static void yy_reduce(
setSqlInfo
(
pInfo
,
pAlterTable
,
NULL
,
TSDB_SQL_ALTER_TABLE
);
}
break
;
case
26
3
:
/* cmd ::= KILL CONNECTION INTEGER */
case
26
4
:
/* cmd ::= KILL CONNECTION INTEGER */
{
setKillSql
(
pInfo
,
TSDB_SQL_KILL_CONNECTION
,
&
yymsp
[
0
].
minor
.
yy0
);}
break
;
case
26
4
:
/* cmd ::= KILL STREAM INTEGER COLON INTEGER */
case
26
5
:
/* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
+
yymsp
[
0
].
minor
.
yy0
.
n
);
setKillSql
(
pInfo
,
TSDB_SQL_KILL_STREAM
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
break
;
case
26
5
:
/* cmd ::= KILL QUERY INTEGER COLON INTEGER */
case
26
6
:
/* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{
yymsp
[
-
2
].
minor
.
yy0
.
n
+=
(
yymsp
[
-
1
].
minor
.
yy0
.
n
+
yymsp
[
0
].
minor
.
yy0
.
n
);
setKillSql
(
pInfo
,
TSDB_SQL_KILL_QUERY
,
&
yymsp
[
-
2
].
minor
.
yy0
);}
break
;
default:
...
...
src/sync/inc/syncInt.h
浏览文件 @
48c0805f
...
...
@@ -35,7 +35,7 @@ extern "C" {
#define SYNC_MAX_SIZE (TSDB_MAX_WAL_SIZE + sizeof(SWalHead) + sizeof(SSyncHead) + 16)
#define SYNC_RECV_BUFFER_SIZE (5*1024*1024)
#define SYNC_MAX_FWDS
512
#define SYNC_MAX_FWDS
1024
#define SYNC_FWD_TIMER 300
#define SYNC_ROLE_TIMER 15000 // ms
#define SYNC_CHECK_INTERVAL 1000 // ms
...
...
src/sync/src/syncMain.c
浏览文件 @
48c0805f
...
...
@@ -1459,7 +1459,12 @@ static int32_t syncForwardToPeerImpl(SSyncNode *pNode, void *data, void *mhandle
if
((
pNode
->
quorum
>
1
||
force
)
&&
code
==
0
)
{
code
=
syncSaveFwdInfo
(
pNode
,
pWalHead
->
version
,
mhandle
);
if
(
code
>=
0
)
code
=
1
;
if
(
code
>=
0
)
{
code
=
1
;
}
else
{
pthread_mutex_unlock
(
&
pNode
->
mutex
);
return
code
;
}
}
int32_t
retLen
=
taosWriteMsg
(
pPeer
->
peerFd
,
pSyncHead
,
fwdLen
);
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
48c0805f
...
...
@@ -364,7 +364,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
// register the qhandle to connect to quit query immediate if connection is broken
if
(
vnodeNotifyCurrentQhandle
(
pRead
->
rpcHandle
,
pRetrieve
->
qId
,
*
handle
,
pVnode
->
vgId
)
!=
TSDB_CODE_SUCCESS
)
{
vError
(
"vgId:%d, QInfo:%"
PRIu64
"-%p, retrieve discarded since link is broken, %p"
,
pVnode
->
vgId
,
pRetrieve
->
qhandle
,
*
handle
,
pRead
->
rpcHandle
);
vError
(
"vgId:%d, QInfo:%"
PRIu64
"-%p, retrieve discarded since link is broken,
conn:
%p"
,
pVnode
->
vgId
,
pRetrieve
->
qhandle
,
*
handle
,
pRead
->
rpcHandle
);
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
qKillQuery
(
*
handle
);
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
true
);
...
...
@@ -409,7 +409,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
// client is broken, the query needs to be killed immediately.
int32_t
vnodeNotifyCurrentQhandle
(
void
*
handle
,
uint64_t
qId
,
void
*
qhandle
,
int32_t
vgId
)
{
SRetrieveTableMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SRetrieveTableMsg
));
pMsg
->
q
handle
=
htobe64
((
uint64_t
)
qhandle
);
pMsg
->
q
Id
=
htobe64
(
qId
);
pMsg
->
header
.
vgId
=
htonl
(
vgId
);
pMsg
->
header
.
contLen
=
htonl
(
sizeof
(
SRetrieveTableMsg
));
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
48c0805f
...
...
@@ -91,13 +91,17 @@ int32_t vnodeProcessWrite(void *vparam, void *wparam, int32_t qtype, void *rpara
int32_t
syncCode
=
0
;
bool
force
=
(
pWrite
==
NULL
?
false
:
pWrite
->
pHead
.
msgType
!=
TSDB_MSG_TYPE_SUBMIT
);
syncCode
=
syncForwardToPeer
(
pVnode
->
sync
,
pHead
,
pWrite
,
qtype
,
force
);
if
(
syncCode
<
0
)
return
syncCode
;
if
(
syncCode
<
0
)
{
pHead
->
version
=
0
;
return
syncCode
;
}
// write into WAL
code
=
walWrite
(
pVnode
->
wal
,
pHead
);
if
(
code
<
0
)
{
if
(
syncCode
>
0
)
atomic_sub_fetch_32
(
&
pWrite
->
processedCount
,
1
);
vError
(
"vgId:%d, hver:%"
PRIu64
" vver:%"
PRIu64
" code:0x%x"
,
pVnode
->
vgId
,
pHead
->
version
,
pVnode
->
version
,
code
);
pHead
->
version
=
0
;
return
code
;
}
...
...
tests/examples/go/taosdemo.go
浏览文件 @
48c0805f
...
...
@@ -16,24 +16,26 @@ package main
import
(
"database/sql"
"flag"
"fmt"
_
"github.com/taosdata/driver-go/taosSql
"
"math/rand
"
"os"
"sync"
"runtime"
"strconv"
"sync"
"time"
"flag"
"math/rand"
_
"github.com/taosdata/driver-go/taosSql"
//"golang.org/x/sys/unix"
)
const
(
maxLocationSize
=
32
maxSqlBufSize
=
65480
//maxSqlBufSize =
65480
)
var
locations
=
[
maxLocationSize
]
string
{
var
locations
=
[
maxLocationSize
]
string
{
"Beijing"
,
"Shanghai"
,
"Guangzhou"
,
"Shenzhen"
,
"HangZhou"
,
"Tianjin"
,
"Wuhan"
,
"Changsha"
,
"Nanjing"
,
"Xian"
}
...
...
@@ -62,7 +64,7 @@ var taosDriverName = "taosSql"
var
url
string
func
init
()
{
flag
.
StringVar
(
&
configPara
.
hostName
,
"h"
,
"127.0.0.1"
,
"The host to connect to TDengine server."
)
flag
.
StringVar
(
&
configPara
.
hostName
,
"h"
,
"127.0.0.1"
,
"The host to connect to TDengine server."
)
flag
.
IntVar
(
&
configPara
.
serverPort
,
"p"
,
6030
,
"The TCP/IP port number to use for the connection to TDengine server."
)
flag
.
StringVar
(
&
configPara
.
user
,
"u"
,
"root"
,
"The TDengine user name to use when connecting to the server."
)
flag
.
StringVar
(
&
configPara
.
password
,
"P"
,
"taosdata"
,
"The password to use when connecting to the server."
)
...
...
@@ -80,7 +82,7 @@ func init() {
configPara
.
supTblName
=
"meters"
startTs
,
err
:=
time
.
ParseInLocation
(
"2006-01-02 15:04:05"
,
configPara
.
startTimestamp
,
time
.
Local
)
if
err
==
nil
{
if
err
==
nil
{
configPara
.
startTs
=
startTs
.
UnixNano
()
/
1e6
}
}
...
...
@@ -104,7 +106,7 @@ func printAllArgs() {
func
main
()
{
printAllArgs
()
fmt
.
Printf
(
"Please press enter key to continue....
\n
"
)
fmt
.
Scanln
()
_
,
_
=
fmt
.
Scanln
()
url
=
"root:taosdata@/tcp("
+
configPara
.
hostName
+
":"
+
strconv
.
Itoa
(
configPara
.
serverPort
)
+
")/"
//url = fmt.Sprintf("%s:%s@/tcp(%s:%d)/%s?interpolateParams=true", configPara.user, configPara.password, configPara.hostName, configPara.serverPort, configPara.dbName)
...
...
@@ -138,7 +140,7 @@ func main() {
func
createDatabase
(
dbName
string
,
supTblName
string
)
{
db
,
err
:=
sql
.
Open
(
taosDriverName
,
url
)
if
err
!=
nil
{
fmt
.
Print
ln
(
"Open database error: %s
\n
"
,
err
)
fmt
.
Print
f
(
"Open database error: %s
\n
"
,
err
)
os
.
Exit
(
1
)
}
defer
db
.
Close
()
...
...
@@ -165,27 +167,27 @@ func createDatabase(dbName string, supTblName string) {
checkErr
(
err
,
sqlStr
)
}
func
multiThreadCreateTable
(
threads
int
,
n
t
ables
int
,
dbName
string
,
tablePrefix
string
)
{
func
multiThreadCreateTable
(
threads
int
,
n
T
ables
int
,
dbName
string
,
tablePrefix
string
)
{
st
:=
time
.
Now
()
.
UnixNano
()
if
(
threads
<
1
)
{
threads
=
1
;
if
threads
<
1
{
threads
=
1
}
a
:=
n
tables
/
threads
;
if
(
a
<
1
)
{
threads
=
n
tables
;
a
=
1
;
a
:=
n
Tables
/
threads
if
a
<
1
{
threads
=
n
Tables
a
=
1
}
b
:=
n
tables
%
threads
;
b
:=
n
Tables
%
threads
last
:=
0
;
last
:=
0
endTblId
:=
0
wg
:=
sync
.
WaitGroup
{}
for
i
:=
0
;
i
<
threads
;
i
++
{
startTblId
:=
last
if
(
i
<
b
)
{
if
i
<
b
{
endTblId
=
last
+
a
}
else
{
endTblId
=
last
+
a
-
1
...
...
@@ -206,7 +208,7 @@ func createTable(dbName string, childTblPrefix string, startTblId int, endTblId
db
,
err
:=
sql
.
Open
(
taosDriverName
,
url
)
if
err
!=
nil
{
fmt
.
Print
ln
(
"Open database error: %s
\n
"
,
err
)
fmt
.
Print
f
(
"Open database error: %s
\n
"
,
err
)
os
.
Exit
(
1
)
}
defer
db
.
Close
()
...
...
@@ -228,20 +230,21 @@ func generateRowData(ts int64) string {
values
:=
"( "
+
strconv
.
FormatInt
(
ts
,
10
)
+
", "
+
strconv
.
FormatFloat
(
float64
(
current
),
'f'
,
6
,
64
)
+
", "
+
strconv
.
Itoa
(
voltage
)
+
", "
+
strconv
.
FormatFloat
(
float64
(
phase
),
'f'
,
6
,
64
)
+
" ) "
return
values
}
func
insertData
(
dbName
string
,
childTblPrefix
string
,
startTblId
int
,
endTblId
int
,
wg
*
sync
.
WaitGroup
)
{
//fmt.Printf("subThread[%d]: insert data to table from %d to %d \n", unix.Gettid(), startTblId, endTblId)
// windows.GetCurrentThreadId()
db
,
err
:=
sql
.
Open
(
taosDriverName
,
url
)
if
err
!=
nil
{
fmt
.
Print
ln
(
"Open database error: %s
\n
"
,
err
)
fmt
.
Print
f
(
"Open database error: %s
\n
"
,
err
)
os
.
Exit
(
1
)
}
defer
db
.
Close
()
tmpTs
:=
configPara
.
startTs
;
tmpTs
:=
configPara
.
startTs
//rand.New(rand.NewSource(time.Now().UnixNano()))
for
tID
:=
startTblId
;
tID
<=
endTblId
;
tID
++
{
for
tID
:=
startTblId
;
tID
<=
endTblId
;
tID
++
{
totalNum
:=
0
for
{
sqlStr
:=
"insert into "
+
dbName
+
"."
+
childTblPrefix
+
strconv
.
Itoa
(
tID
)
+
" values "
...
...
@@ -254,7 +257,7 @@ func insertData(dbName string, childTblPrefix string, startTblId int, endTblId i
sqlStr
=
fmt
.
Sprintf
(
"%s %s"
,
sqlStr
,
valuesOfRow
)
if
(
currRowNum
>=
configPara
.
numOfRecordsPerReq
||
totalNum
>=
configPara
.
numOfRecordsPerTable
)
{
if
currRowNum
>=
configPara
.
numOfRecordsPerReq
||
totalNum
>=
configPara
.
numOfRecordsPerTable
{
break
}
}
...
...
@@ -265,12 +268,12 @@ func insertData(dbName string, childTblPrefix string, startTblId int, endTblId i
count
,
err
:=
res
.
RowsAffected
()
checkErr
(
err
,
"rows affected"
)
if
(
count
!=
int64
(
currRowNum
)
)
{
if
count
!=
int64
(
currRowNum
)
{
fmt
.
Printf
(
"insert data, expect affected:%d, actual:%d
\n
"
,
currRowNum
,
count
)
os
.
Exit
(
1
)
}
if
(
totalNum
>=
configPara
.
numOfRecordsPerTable
)
{
if
totalNum
>=
configPara
.
numOfRecordsPerTable
{
break
}
}
...
...
@@ -279,44 +282,46 @@ func insertData(dbName string, childTblPrefix string, startTblId int, endTblId i
wg
.
Done
()
runtime
.
Goexit
()
}
func
multiThreadInsertData
(
threads
int
,
ntables
int
,
dbName
string
,
tablePrefix
string
)
{
func
multiThreadInsertData
(
threads
int
,
nTables
int
,
dbName
string
,
tablePrefix
string
)
{
st
:=
time
.
Now
()
.
UnixNano
()
if
(
threads
<
1
)
{
threads
=
1
;
if
threads
<
1
{
threads
=
1
}
a
:=
n
tables
/
threads
;
if
(
a
<
1
)
{
threads
=
n
tables
;
a
=
1
;
a
:=
n
Tables
/
threads
if
a
<
1
{
threads
=
n
Tables
a
=
1
}
b
:=
n
tables
%
threads
;
b
:=
n
Tables
%
threads
last
:=
0
;
last
:=
0
endTblId
:=
0
wg
:=
sync
.
WaitGroup
{}
for
i
:=
0
;
i
<
threads
;
i
++
{
startTblId
:=
last
if
(
i
<
b
)
{
if
i
<
b
{
endTblId
=
last
+
a
}
else
{
endTblId
=
last
+
a
-
1
}
last
=
endTblId
+
1
wg
.
Add
(
1
)
go
insertData
(
dbName
,
tablePrefix
,
startTblId
,
endTblId
,
&
wg
)
go
insertData
(
dbName
,
tablePrefix
,
startTblId
,
endTblId
,
&
wg
)
}
wg
.
Wait
()
et
:=
time
.
Now
()
.
UnixNano
()
fmt
.
Printf
(
"insert data spent duration: %6.6fs
\n
"
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
selectTest
(
dbName
string
,
tbPrefix
string
,
supTblName
string
){
func
selectTest
(
dbName
string
,
tbPrefix
string
,
supTblName
string
)
{
db
,
err
:=
sql
.
Open
(
taosDriverName
,
url
)
if
err
!=
nil
{
fmt
.
Print
ln
(
"Open database error: %s
\n
"
,
err
)
fmt
.
Print
f
(
"Open database error: %s
\n
"
,
err
)
os
.
Exit
(
1
)
}
defer
db
.
Close
()
...
...
@@ -352,7 +357,7 @@ func selectTest(dbName string, tbPrefix string, supTblName string){
}
// select sql 2
sqlStr
=
"select avg(voltage), min(voltage), max(voltage) from "
+
dbName
+
"."
+
tbPrefix
+
strconv
.
Itoa
(
rand
.
Int
()
%
configPara
.
numOftables
)
sqlStr
=
"select avg(voltage), min(voltage), max(voltage) from "
+
dbName
+
"."
+
tbPrefix
+
strconv
.
Itoa
(
rand
.
Int
()
%
configPara
.
numOftables
)
rows
,
err
=
db
.
Query
(
sqlStr
)
checkErr
(
err
,
sqlStr
)
...
...
tests/pytest/tools/insert-tblimit-tboffset-createdb.json
0 → 100644
浏览文件 @
48c0805f
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"thread_count"
:
4
,
"thread_count_create_tbl"
:
4
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"num_of_records_per_req"
:
100
,
"max_sql_len"
:
1024000
,
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"keep"
:
365
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
,
"walLevel"
:
1
,
"cachelast"
:
0
,
"quorum"
:
1
,
"fsync"
:
3000
,
"update"
:
0
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"rand"
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
0
,
"multi_thread_write_one_tbl"
:
"no"
,
"number_of_tbl_in_one_sql"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
},
{
"type"
:
"DOUBLE"
,
"count"
:
10
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
3
},
{
"type"
:
"BINARY"
,
"len"
:
32
,
"count"
:
6
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
}]
}]
}
tests/pytest/tools/insert-tblimit-tboffset-insertrec.json
0 → 100644
浏览文件 @
48c0805f
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"thread_count"
:
4
,
"thread_count_create_tbl"
:
4
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"num_of_records_per_req"
:
100
,
"max_sql_len"
:
1024000
,
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"no"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"keep"
:
365
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
,
"walLevel"
:
1
,
"cachelast"
:
0
,
"quorum"
:
1
,
"fsync"
:
3000
,
"update"
:
0
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"yes"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"rand"
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
1000
,
"childtable_limit"
:
33
,
"childtable_offset"
:
33
,
"multi_thread_write_one_tbl"
:
"no"
,
"number_of_tbl_in_one_sql"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
},
{
"type"
:
"DOUBLE"
,
"count"
:
10
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
3
},
{
"type"
:
"BINARY"
,
"len"
:
32
,
"count"
:
6
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
}]
}]
}
tests/pytest/tools/insert-tblimit-tboffset0.json
浏览文件 @
48c0805f
...
...
@@ -15,7 +15,7 @@
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"
yes
"
,
"drop"
:
"
no
"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
...
...
@@ -33,7 +33,7 @@
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"
no
"
,
"child_table_exists"
:
"
yes
"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
...
...
tests/pytest/tools/insert-tblimit1-tboffset.json
浏览文件 @
48c0805f
...
...
@@ -15,7 +15,7 @@
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"
yes
"
,
"drop"
:
"
no
"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
16
,
...
...
@@ -33,7 +33,7 @@
},
"super_tables"
:
[{
"name"
:
"stb"
,
"child_table_exists"
:
"
no
"
,
"child_table_exists"
:
"
yes
"
,
"childtable_count"
:
100
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
...
...
tests/pytest/tools/taosdemo-sampledata.json
浏览文件 @
48c0805f
...
...
@@ -16,8 +16,6 @@
"name"
:
"stb"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
20
,
"childtable_limit"
:
10
,
"childtable_offset"
:
0
,
"childtable_prefix"
:
"t_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"sample"
,
...
...
tests/pytest/tools/taosdemoTestLimitOffset.py
浏览文件 @
48c0805f
...
...
@@ -51,7 +51,8 @@ class TDTestCase:
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/"
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-createdb.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-insertrec.json"
%
binPath
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"select count(tbname) from db.stb"
)
...
...
@@ -59,6 +60,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
33000
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-createdb.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset0.json"
%
binPath
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -68,6 +70,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
20000
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit-tboffset-createdb.json"
%
binPath
)
os
.
system
(
"%staosdemo -f tools/insert-tblimit1-tboffset.json"
%
binPath
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/pytest/tools/taosdemoTestSampleData.py
浏览文件 @
48c0805f
...
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(tbname) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
20
)
tdSql
.
query
(
"select count(*) from db.stb"
)
tdSql
.
checkData
(
0
,
0
,
2
00
)
tdSql
.
checkData
(
0
,
0
,
4
00
)
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/script/general/parser/topbot.sim
浏览文件 @
48c0805f
...
...
@@ -325,4 +325,56 @@ if $row != 0 then
return -1
endi
print ===============================>td-3621
sql create table ttm2(ts timestamp, k bool);
sql insert into ttm2 values('2021-1-1 1:1:1', true)
sql insert into ttm2 values('2021-1-1 1:1:2', NULL)
sql insert into ttm2 values('2021-1-1 1:1:3', false)
sql select * from ttm2 where k is not null
if $row != 2 then
return -1
endi
if $data00 != @21-01-01 01:01:01.000@ then
print expect 21-01-01 01:01:01.000, actual $data00
return -1
endi
sql select * from ttm2 where k is null
if $row != 1 then
return -1
endi
if $data00 != @21-01-01 01:01:02.000@ then
return -1
endi
sql select * from ttm2 where k=true
if $row != 1 then
return -1
endi
if $data00 != @21-01-01 01:01:01.000@ then
return -1
endi
sql select * from ttm2 where k=false
if $row != 1 then
return -1
endi
if $data00 != @21-01-01 01:01:03.000@ then
return -1
endi
sql select * from ttm2 where k<>false
if $row != 1 then
return -1
endi
sql_error select * from ttm2 where k=null
sql_error select * from ttm2 where k<>null
sql_error select * from ttm2 where k like null
sql_error select * from ttm2 where k<null
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录