Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cc3a7375
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cc3a7375
编写于
8月 01, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: support app level stat
上级
27437d85
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
208 addition
and
138 deletion
+208
-138
include/common/systable.h
include/common/systable.h
+30
-30
include/common/tmsg.h
include/common/tmsg.h
+1
-0
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-0
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+3
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+12
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+35
-3
source/client/src/clientMain.c
source/client/src/clientMain.c
+17
-0
source/common/src/systable.c
source/common/src/systable.c
+9
-9
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+8
-8
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+11
-11
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+7
-7
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+3
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+14
-14
source/libs/parser/test/mockCatalog.cpp
source/libs/parser/test/mockCatalog.cpp
+7
-7
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+3
-3
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+1
-0
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+1
-0
tests/script/tsim/query/explain.sim
tests/script/tsim/query/explain.sim
+5
-5
tests/script/tsim/show/basic.sim
tests/script/tsim/show/basic.sim
+26
-26
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
+2
-2
tests/script/tsim/tmq/snapshot1.sim
tests/script/tsim/tmq/snapshot1.sim
+2
-2
tests/script/tsim/valgrind/checkError1.sim
tests/script/tsim/valgrind/checkError1.sim
+7
-7
tests/script/tsim/valgrind/checkError6.sim
tests/script/tsim/valgrind/checkError6.sim
+3
-3
未找到文件。
include/common/systable.h
浏览文件 @
cc3a7375
...
...
@@ -23,38 +23,38 @@ extern "C" {
#define TDENGINE_SYSTABLE_H
#define TSDB_INFORMATION_SCHEMA_DB "information_schema"
#define TSDB_INS_TABLE_DNODES "dnodes"
#define TSDB_INS_TABLE_MNODES "mnodes"
#define TSDB_INS_TABLE_MODULES "modules"
#define TSDB_INS_TABLE_QNODES "qnodes"
#define TSDB_INS_TABLE_BNODES "bnodes"
#define TSDB_INS_TABLE_SNODES "snodes"
#define TSDB_INS_TABLE_CLUSTER "cluster"
#define TSDB_INS_TABLE_
USER_DATABASES "user
_databases"
#define TSDB_INS_TABLE_
USER_FUNCTIONS "user
_functions"
#define TSDB_INS_TABLE_
USER_INDEXES "user
_indexes"
#define TSDB_INS_TABLE_
USER_STABLES "user
_stables"
#define TSDB_INS_TABLE_
USER_TABLES "user
_tables"
#define TSDB_INS_TABLE_
USER_TAGS "user
_tags"
#define TSDB_INS_TABLE_
USER_TABLE_DISTRIBUTED "user
_table_distributed"
#define TSDB_INS_TABLE_USER
_USERS "user
_users"
#define TSDB_INS_TABLE_LICENCES "grants"
#define TSDB_INS_TABLE_VGROUPS "vgroups"
#define TSDB_INS_TABLE_VNODES "vnodes"
#define TSDB_INS_TABLE_CONFIGS "configs"
#define TSDB_INS_TABLE_DNODE_VARIABLES "dnode_variables"
#define TSDB_INS_TABLE_DNODES "
ins_
dnodes"
#define TSDB_INS_TABLE_MNODES "
ins_
mnodes"
#define TSDB_INS_TABLE_MODULES "
ins_
modules"
#define TSDB_INS_TABLE_QNODES "
ins_
qnodes"
#define TSDB_INS_TABLE_BNODES "
ins_
bnodes"
#define TSDB_INS_TABLE_SNODES "
ins_
snodes"
#define TSDB_INS_TABLE_CLUSTER "
ins_
cluster"
#define TSDB_INS_TABLE_
DATABASES "ins
_databases"
#define TSDB_INS_TABLE_
FUNCTIONS "ins
_functions"
#define TSDB_INS_TABLE_
INDEXES "ins
_indexes"
#define TSDB_INS_TABLE_
STABLES "ins
_stables"
#define TSDB_INS_TABLE_
TABLES "ins
_tables"
#define TSDB_INS_TABLE_
TAGS "ins
_tags"
#define TSDB_INS_TABLE_
TABLE_DISTRIBUTED "ins
_table_distributed"
#define TSDB_INS_TABLE_USER
S "ins
_users"
#define TSDB_INS_TABLE_LICENCES "
ins_
grants"
#define TSDB_INS_TABLE_VGROUPS "
ins_
vgroups"
#define TSDB_INS_TABLE_VNODES "
ins_
vnodes"
#define TSDB_INS_TABLE_CONFIGS "
ins_
configs"
#define TSDB_INS_TABLE_DNODE_VARIABLES "
ins_
dnode_variables"
#define TSDB_PERFORMANCE_SCHEMA_DB "performance_schema"
#define TSDB_PERFS_TABLE_SMAS "smas"
#define TSDB_PERFS_TABLE_CONNECTIONS "connections"
#define TSDB_PERFS_TABLE_QUERIES "queries"
#define TSDB_PERFS_TABLE_TOPICS "topics"
#define TSDB_PERFS_TABLE_CONSUMERS "consumers"
#define TSDB_PERFS_TABLE_SUBSCRIPTIONS "subscriptions"
#define TSDB_PERFS_TABLE_OFFSETS "offsets"
#define TSDB_PERFS_TABLE_TRANS "trans"
#define TSDB_PERFS_TABLE_STREAMS "streams"
#define TSDB_PERFS_TABLE_APPS "apps"
#define TSDB_PERFS_TABLE_SMAS "
perf_
smas"
#define TSDB_PERFS_TABLE_CONNECTIONS "
perf_
connections"
#define TSDB_PERFS_TABLE_QUERIES "
perf_
queries"
#define TSDB_PERFS_TABLE_TOPICS "
perf_
topics"
#define TSDB_PERFS_TABLE_CONSUMERS "
perf_
consumers"
#define TSDB_PERFS_TABLE_SUBSCRIPTIONS "
perf_
subscriptions"
#define TSDB_PERFS_TABLE_OFFSETS "
perf_
offsets"
#define TSDB_PERFS_TABLE_TRANS "
perf_
trans"
#define TSDB_PERFS_TABLE_STREAMS "
perf_
streams"
#define TSDB_PERFS_TABLE_APPS "
perf_
apps"
typedef
struct
SSysDbTableSchema
{
const
char
*
name
;
...
...
include/common/tmsg.h
浏览文件 @
cc3a7375
...
...
@@ -2223,6 +2223,7 @@ typedef struct SAppClusterSummary {
uint64_t
insertBytes
;
// submit to tsdb since launched.
uint64_t
fetchBytes
;
uint64_t
numOfQueryReq
;
uint64_t
queryElapsedTime
;
uint64_t
numOfSlowQueries
;
uint64_t
totalRequests
;
...
...
include/libs/qcom/query.h
浏览文件 @
cc3a7375
...
...
@@ -71,6 +71,7 @@ typedef struct SIndexMeta {
typedef
struct
SExecResult
{
int32_t
code
;
uint64_t
numOfRows
;
uint64_t
numOfBytes
;
int32_t
msgType
;
void
*
res
;
}
SExecResult
;
...
...
source/client/inc/clientInt.h
浏览文件 @
cc3a7375
...
...
@@ -225,10 +225,12 @@ typedef struct SRequestObj {
SArray
*
targetTableList
;
SQueryExecMetric
metric
;
SRequestSendRecvBody
body
;
int32_t
stmtType
;
bool
syncQuery
;
// todo refactor: async query object
bool
stableQuery
;
// todo refactor
bool
validateOnly
;
// todo refactor
bool
killed
;
bool
inRetry
;
uint32_t
prevCode
;
// previous error code: todo refactor, add update flag for catalog
uint32_t
retry
;
}
SRequestObj
;
...
...
@@ -326,7 +328,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet);
STscObj
*
taos_connect_internal
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
auth
,
const
char
*
db
,
uint16_t
port
,
int
connType
);
SRequestObj
*
launchQuery
(
uint64_t
connId
,
const
char
*
sql
,
int
sqlLen
,
bool
validateOnly
);
SRequestObj
*
launchQuery
(
uint64_t
connId
,
const
char
*
sql
,
int
sqlLen
,
bool
validateOnly
,
bool
inRetry
);
int32_t
parseSql
(
SRequestObj
*
pRequest
,
bool
topicQuery
,
SQuery
**
pQuery
,
SStmtCallback
*
pStmtCb
);
...
...
source/client/src/clientEnv.c
浏览文件 @
cc3a7375
...
...
@@ -60,6 +60,7 @@ static int32_t registerRequest(SRequestObj *pRequest, STscObj *pTscObj) {
}
static
void
deregisterRequest
(
SRequestObj
*
pRequest
)
{
const
static
int64_t
SLOW_QUERY_INTERVAL
=
3000000L
;
// todo configurable
assert
(
pRequest
!=
NULL
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
...
...
@@ -72,6 +73,17 @@ static void deregisterRequest(SRequestObj *pRequest) {
tscDebug
(
"0x%"
PRIx64
" free Request from connObj: 0x%"
PRIx64
", reqId:0x%"
PRIx64
" elapsed:%"
PRIu64
" ms, current:%d, app current:%d"
,
pRequest
->
self
,
pTscObj
->
id
,
pRequest
->
requestId
,
duration
/
1000
,
num
,
currentInst
);
if
(
QUERY_NODE_VNODE_MODIF_STMT
==
pRequest
->
stmtType
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
insertElapsedTime
,
duration
);
}
else
if
(
QUERY_NODE_SELECT_STMT
==
pRequest
->
stmtType
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
queryElapsedTime
,
duration
);
}
if
(
duration
>=
SLOW_QUERY_INTERVAL
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfSlowQueries
,
1
);
}
releaseTscObj
(
pTscObj
->
id
);
}
...
...
source/client/src/clientImpl.c
浏览文件 @
cc3a7375
...
...
@@ -688,7 +688,12 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
||
TDMT_VND_DELETE
==
pRequest
->
type
||
TDMT_VND_CREATE_TABLE
==
pRequest
->
type
)
{
pRequest
->
body
.
resInfo
.
numOfRows
=
res
.
numOfRows
;
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
)
{
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfInsertRows
,
res
.
numOfRows
);
}
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
}
...
...
@@ -795,6 +800,8 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) {
break
;
}
case
TDMT_VND_SUBMIT
:
{
atomic_add_fetch_64
((
int64_t
*
)
&
pAppInfo
->
summary
.
insertBytes
,
pRes
->
numOfBytes
);
code
=
handleSubmitExecRes
(
pRequest
,
pRes
->
res
,
pCatalog
,
&
epset
);
break
;
}
...
...
@@ -824,6 +831,11 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
TDMT_VND_CREATE_TABLE
==
pRequest
->
type
)
{
if
(
pResult
)
{
pRequest
->
body
.
resInfo
.
numOfRows
=
pResult
->
numOfRows
;
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
)
{
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfInsertRows
,
pResult
->
numOfRows
);
}
}
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
...
...
@@ -862,6 +874,18 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
SRequestObj
*
launchQueryImpl
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
bool
keepQuery
,
void
**
res
)
{
int32_t
code
=
0
;
pRequest
->
stmtType
=
pQuery
->
pRoot
->
type
;
if
(
!
pRequest
->
inRetry
)
{
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
if
(
QUERY_NODE_VNODE_MODIF_STMT
==
pQuery
->
pRoot
->
type
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfInsertsReq
,
1
);
}
else
if
(
QUERY_NODE_SELECT_STMT
==
pQuery
->
pRoot
->
type
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfQueryReq
,
1
);
}
}
switch
(
pQuery
->
execMode
)
{
case
QUERY_EXEC_MODE_LOCAL
:
if
(
!
pRequest
->
validateOnly
)
{
...
...
@@ -915,7 +939,7 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue
return
pRequest
;
}
SRequestObj
*
launchQuery
(
uint64_t
connId
,
const
char
*
sql
,
int
sqlLen
,
bool
validateOnly
)
{
SRequestObj
*
launchQuery
(
uint64_t
connId
,
const
char
*
sql
,
int
sqlLen
,
bool
validateOnly
,
bool
inRetry
)
{
SRequestObj
*
pRequest
=
NULL
;
SQuery
*
pQuery
=
NULL
;
...
...
@@ -931,6 +955,7 @@ SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool vali
return
pRequest
;
}
pRequest
->
inRetry
=
inRetry
;
pRequest
->
stableQuery
=
pQuery
->
stableQuery
;
return
launchQueryImpl
(
pRequest
,
pQuery
,
false
,
NULL
);
...
...
@@ -1079,10 +1104,11 @@ SRequestObj* execQuery(uint64_t connId, const char* sql, int sqlLen, bool valida
SRequestObj
*
pRequest
=
NULL
;
int32_t
retryNum
=
0
;
int32_t
code
=
0
;
bool
inRetry
=
false
;
do
{
destroyRequest
(
pRequest
);
pRequest
=
launchQuery
(
connId
,
sql
,
sqlLen
,
validateOnly
);
pRequest
=
launchQuery
(
connId
,
sql
,
sqlLen
,
validateOnly
,
inRetry
);
if
(
pRequest
==
NULL
||
TSDB_CODE_SUCCESS
==
pRequest
->
code
||
!
NEED_CLIENT_HANDLE_ERROR
(
pRequest
->
code
))
{
break
;
}
...
...
@@ -1092,6 +1118,8 @@ SRequestObj* execQuery(uint64_t connId, const char* sql, int sqlLen, bool valida
pRequest
->
code
=
code
;
break
;
}
inRetry
=
true
;
}
while
(
retryNum
++
<
REQUEST_TOTAL_EXEC_TIMES
);
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
...
...
@@ -1437,6 +1465,10 @@ void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4)
tscDebug
(
"0x%"
PRIx64
" fetch results, numOfRows:%d total Rows:%"
PRId64
", complete:%d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pResInfo
->
numOfRows
,
pResInfo
->
totalRows
,
pResInfo
->
completed
,
pRequest
->
requestId
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
fetchBytes
,
pRequest
->
body
.
resInfo
.
payloadLen
);
if
(
pResultInfo
->
numOfRows
==
0
)
{
return
NULL
;
}
...
...
source/client/src/clientMain.c
浏览文件 @
cc3a7375
...
...
@@ -679,6 +679,9 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
if
(
code
==
TSDB_CODE_SUCCESS
)
{
code
=
qAnalyseSqlSemantic
(
pWrapper
->
pCtx
,
&
pWrapper
->
catalogReq
,
pResultMeta
,
pQuery
);
pRequest
->
stableQuery
=
pQuery
->
stableQuery
;
if
(
pQuery
->
pRoot
)
{
pRequest
->
stmtType
=
pQuery
->
pRoot
->
type
;
}
}
if
(
code
==
TSDB_CODE_SUCCESS
)
{
...
...
@@ -778,6 +781,16 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
goto
_error
;
}
if
(
!
updateMetaForce
)
{
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
if
(
NULL
==
pQuery
->
pRoot
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfInsertsReq
,
1
);
}
else
if
(
QUERY_NODE_SELECT_STMT
==
pQuery
->
pRoot
->
type
)
{
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
numOfQueryReq
,
1
);
}
}
SqlParseWrapper
*
pWrapper
=
taosMemoryCalloc
(
1
,
sizeof
(
SqlParseWrapper
));
if
(
pWrapper
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -841,6 +854,10 @@ static void fetchCallback(void *pResult, void *param, int32_t code) {
tscDebug
(
"0x%"
PRIx64
" fetch results, numOfRows:%d total Rows:%"
PRId64
", complete:%d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pResultInfo
->
numOfRows
,
pResultInfo
->
totalRows
,
pResultInfo
->
completed
,
pRequest
->
requestId
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SAppClusterSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
atomic_add_fetch_64
((
int64_t
*
)
&
pActivity
->
fetchBytes
,
pRequest
->
body
.
resInfo
.
payloadLen
);
}
pRequest
->
body
.
fetchFp
(
pRequest
->
body
.
param
,
pRequest
,
pResultInfo
->
numOfRows
);
...
...
source/common/src/systable.c
浏览文件 @
cc3a7375
...
...
@@ -260,14 +260,14 @@ static const SSysTableMeta infosMeta[] = {
// {TSDB_INS_TABLE_SNODES, snodesSchema, tListLen(snodesSchema)},
// {TSDB_INS_TABLE_BNODES, bnodesSchema, tListLen(bnodesSchema)},
{
TSDB_INS_TABLE_CLUSTER
,
clusterSchema
,
tListLen
(
clusterSchema
)},
{
TSDB_INS_TABLE_
USER_
DATABASES
,
userDBSchema
,
tListLen
(
userDBSchema
)},
{
TSDB_INS_TABLE_
USER_
FUNCTIONS
,
userFuncSchema
,
tListLen
(
userFuncSchema
)},
{
TSDB_INS_TABLE_
USER_
INDEXES
,
userIdxSchema
,
tListLen
(
userIdxSchema
)},
{
TSDB_INS_TABLE_
USER_
STABLES
,
userStbsSchema
,
tListLen
(
userStbsSchema
)},
{
TSDB_INS_TABLE_
USER_
TABLES
,
userTblsSchema
,
tListLen
(
userTblsSchema
)},
{
TSDB_INS_TABLE_
USER_
TAGS
,
userTagsSchema
,
tListLen
(
userTagsSchema
)},
// {TSDB_INS_TABLE_
USER_
TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)},
{
TSDB_INS_TABLE_USER
_USER
S
,
userUsersSchema
,
tListLen
(
userUsersSchema
)},
{
TSDB_INS_TABLE_DATABASES
,
userDBSchema
,
tListLen
(
userDBSchema
)},
{
TSDB_INS_TABLE_FUNCTIONS
,
userFuncSchema
,
tListLen
(
userFuncSchema
)},
{
TSDB_INS_TABLE_INDEXES
,
userIdxSchema
,
tListLen
(
userIdxSchema
)},
{
TSDB_INS_TABLE_STABLES
,
userStbsSchema
,
tListLen
(
userStbsSchema
)},
{
TSDB_INS_TABLE_TABLES
,
userTblsSchema
,
tListLen
(
userTblsSchema
)},
{
TSDB_INS_TABLE_TAGS
,
userTagsSchema
,
tListLen
(
userTagsSchema
)},
// {TSDB_INS_TABLE_TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)},
{
TSDB_INS_TABLE_USERS
,
userUsersSchema
,
tListLen
(
userUsersSchema
)},
{
TSDB_INS_TABLE_LICENCES
,
grantsSchema
,
tListLen
(
grantsSchema
)},
{
TSDB_INS_TABLE_VGROUPS
,
vgroupsSchema
,
tListLen
(
vgroupsSchema
)},
{
TSDB_INS_TABLE_CONFIGS
,
configSchema
,
tListLen
(
configSchema
)},
...
...
@@ -349,7 +349,7 @@ static const SSysDbTableSchema appSchema[] = {
{.
name
=
"insert_bytes"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"fetch_bytes"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"query_time"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"s
h
ow_query"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"s
l
ow_query"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"total_req"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"current_req"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_UBIGINT
},
{.
name
=
"last_access"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
},
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
cc3a7375
...
...
@@ -66,21 +66,21 @@ static int32_t convertToRetrieveType(char *name, int32_t len) {
type
=
TSDB_MGMT_TABLE_SNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_CLUSTER
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_CLUSTER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
DATABASES
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_DATABASES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_DB
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
FUNCTIONS
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_FUNCTIONS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_FUNC
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
INDEXES
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_INDEXES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_INDEX
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
STABLES
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_STABLES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_STB
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TABLES
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_TABLE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TAGS
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TAGS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_TAG
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TABLE_DISTRIBUTED
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLE_DISTRIBUTED
,
len
)
==
0
)
{
// type = TSDB_MGMT_TABLE_DIST;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USER
_USER
S
,
len
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_USERS
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_USER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_LICENCES
,
len
)
==
0
)
{
type
=
TSDB_MGMT_TABLE_GRANTS
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
cc3a7375
...
...
@@ -1622,8 +1622,8 @@ static void destroySysScanOperator(void* param, int32_t numOfOutput) {
blockDataDestroy
(
pInfo
->
pRes
);
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
);
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
pInfo
->
pCur
!=
NULL
)
{
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
strncasecmp
(
name
,
TSDB_INS_TABLE_TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
pInfo
->
pCur
!=
NULL
)
{
metaCloseTbCursor
(
pInfo
->
pCur
);
pInfo
->
pCur
=
NULL
;
}
...
...
@@ -1635,7 +1635,7 @@ static void destroySysScanOperator(void* param, int32_t numOfOutput) {
}
static
int32_t
getSysTableDbNameColId
(
const
char
*
pTable
)
{
// if (0 == strcmp(TSDB_INS_TABLE_
USER_
INDEXES, pTable)) {
// if (0 == strcmp(TSDB_INS_TABLE_INDEXES, pTable)) {
// return 1;
// }
return
TSDB_INS_USER_STABLES_DBNAME_COLID
;
...
...
@@ -1851,7 +1851,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
tNameGetDbName
(
&
sn
,
varDataVal
(
dbname
));
varDataSetLen
(
dbname
,
strlen
(
varDataVal
(
dbname
)));
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_
USER_
TAGS
);
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_TAGS
);
blockDataEnsureCapacity
(
p
,
pOperator
->
resultInfo
.
capacity
);
int32_t
ret
=
0
;
...
...
@@ -2022,7 +2022,7 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) {
tNameGetDbName
(
&
sn
,
varDataVal
(
dbname
));
varDataSetLen
(
dbname
,
strlen
(
varDataVal
(
dbname
)));
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_
USER_
TABLES
);
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_TABLES
);
blockDataEnsureCapacity
(
p
,
pOperator
->
resultInfo
.
capacity
);
char
n
[
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
...
...
@@ -2189,11 +2189,11 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
sprintf
(
pInfo
->
req
.
db
,
"%d.%s"
,
pInfo
->
accountId
,
dbName
);
}
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
return
sysTableScanUserTables
(
pOperator
);
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
return
sysTableScanUserTags
(
pOperator
);
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
STABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
&&
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_STABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
&&
IS_SYS_DBNAME
(
pInfo
->
req
.
db
))
{
return
sysTableScanUserSTables
(
pOperator
);
}
else
{
// load the meta from mnode of the given epset
...
...
@@ -2269,7 +2269,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
}
int32_t
buildSysDbTableInfo
(
const
SSysTableScanInfo
*
pInfo
,
int32_t
capacity
)
{
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_
USER_
TABLES
);
SSDataBlock
*
p
=
buildInfoSchemaTableMetaBlock
(
TSDB_INS_TABLE_TABLES
);
blockDataEnsureCapacity
(
p
,
capacity
);
size_t
size
=
0
;
...
...
@@ -2358,8 +2358,8 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan
tNameAssign
(
&
pInfo
->
name
,
&
pScanNode
->
tableName
);
const
char
*
name
=
tNameGetTableName
(
&
pInfo
->
name
);
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
strncasecmp
(
name
,
TSDB_INS_TABLE_
USER_
TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_TABLES
,
TSDB_TABLE_FNAME_LEN
)
==
0
||
strncasecmp
(
name
,
TSDB_INS_TABLE_TAGS
,
TSDB_TABLE_FNAME_LEN
)
==
0
)
{
pInfo
->
readHandle
=
*
(
SReadHandle
*
)
readHandle
;
blockDataEnsureCapacity
(
pInfo
->
pRes
,
pOperator
->
resultInfo
.
capacity
);
}
else
{
...
...
source/libs/parser/src/parAstParser.c
浏览文件 @
cc3a7375
...
...
@@ -334,22 +334,22 @@ static int32_t collectMetaKeyFromShowBnodes(SCollectMetaKeyCxt* pCxt, SShowStmt*
}
static
int32_t
collectMetaKeyFromShowDatabases
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
DATABASES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_DATABASES
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowFunctions
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
FUNCTIONS
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_FUNCTIONS
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowIndexes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
INDEXES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_INDEXES
,
pCxt
->
pMetaCache
);
}
static
int32_t
collectMetaKeyFromShowStables
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
STABLES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_STABLES
,
pCxt
->
pMetaCache
);
}
...
...
@@ -360,7 +360,7 @@ static int32_t collectMetaKeyFromShowStreams(SCollectMetaKeyCxt* pCxt, SShowStmt
static
int32_t
collectMetaKeyFromShowTables
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
int32_t
code
=
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
TABLES
,
pCxt
->
pMetaCache
);
TSDB_INS_TABLE_TABLES
,
pCxt
->
pMetaCache
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
NULL
!=
pStmt
->
pDbName
)
{
code
=
reserveDbVgInfoInCache
(
pCxt
->
pParseCxt
->
acctId
,
((
SValueNode
*
)
pStmt
->
pDbName
)
->
literal
,
pCxt
->
pMetaCache
);
...
...
@@ -372,7 +372,7 @@ static int32_t collectMetaKeyFromShowTables(SCollectMetaKeyCxt* pCxt, SShowStmt*
}
static
int32_t
collectMetaKeyFromShowTags
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
int32_t
code
=
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
TAGS
,
int32_t
code
=
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_TAGS
,
pCxt
->
pMetaCache
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
NULL
!=
pStmt
->
pDbName
)
{
...
...
@@ -385,7 +385,7 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p
}
static
int32_t
collectMetaKeyFromShowUsers
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_USER
_USER
S
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_USERS
,
pCxt
->
pMetaCache
);
}
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
cc3a7375
...
...
@@ -21,6 +21,7 @@
#include "tglobal.h"
#include "ttime.h"
#include "ttypes.h"
#include "query.h"
#define NEXT_TOKEN(pSql, sToken) \
do { \
...
...
@@ -1488,6 +1489,8 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
"keyword VALUES or FILE is expected"
,
sToken
.
z
);
}
qDebug
(
"0x%"
PRIx64
" insert input rows: %d"
,
pCxt
->
pComCxt
->
requestId
,
pCxt
->
totalNum
);
if
(
TSDB_QUERY_HAS_TYPE
(
pCxt
->
pOutput
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
))
{
SParsedDataColInfo
*
tags
=
taosMemoryMalloc
(
sizeof
(
pCxt
->
tags
));
if
(
NULL
==
tags
)
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
cc3a7375
...
...
@@ -1731,9 +1731,9 @@ static int32_t dnodeToVgroupsInfo(SArray* pDnodes, SVgroupsInfo** pVgsInfo) {
}
static
bool
sysTableFromVnode
(
const
char
*
pTable
)
{
return
(
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_
USER_
TABLES
))
||
(
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_
USER_
TABLE_DISTRIBUTED
)
||
(
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_
USER_
TAGS
)));
return
(
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_TABLES
))
||
(
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_TABLE_DISTRIBUTED
)
||
(
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_TAGS
)));
}
static
bool
sysTableFromDnode
(
const
char
*
pTable
)
{
return
0
==
strcmp
(
pTable
,
TSDB_INS_TABLE_DNODE_VARIABLES
);
}
...
...
@@ -1749,7 +1749,7 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName,
code
=
getDBVgInfoImpl
(
pCxt
,
pName
,
&
vgroupList
);
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
0
==
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_
USER_
TABLES
))
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
0
==
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_TABLES
))
{
code
=
addMnodeToVgroupList
(
&
pCxt
->
pParseCxt
->
mgmtEpSet
,
&
vgroupList
);
}
...
...
@@ -1837,9 +1837,9 @@ static bool joinTableIsSingleTable(SJoinTableNode* pJoinTable) {
static
bool
isSingleTable
(
SRealTableNode
*
pRealTable
)
{
int8_t
tableType
=
pRealTable
->
pMeta
->
tableType
;
if
(
TSDB_SYSTEM_TABLE
==
tableType
)
{
return
0
!=
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_
USER_
TABLES
)
&&
0
!=
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_
USER_
TABLE_DISTRIBUTED
)
&&
0
!=
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_
USER_
TAGS
);
return
0
!=
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_TABLES
)
&&
0
!=
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_TABLE_DISTRIBUTED
)
&&
0
!=
strcmp
(
pRealTable
->
table
.
tableName
,
TSDB_INS_TABLE_TAGS
);
}
return
(
TSDB_CHILD_TABLE
==
tableType
||
TSDB_NORMAL_TABLE
==
tableType
);
}
...
...
@@ -5229,15 +5229,15 @@ static const char* getSysDbName(ENodeType type) {
static
const
char
*
getSysTableName
(
ENodeType
type
)
{
switch
(
type
)
{
case
QUERY_NODE_SHOW_DATABASES_STMT
:
return
TSDB_INS_TABLE_
USER_
DATABASES
;
return
TSDB_INS_TABLE_DATABASES
;
case
QUERY_NODE_SHOW_TABLES_STMT
:
return
TSDB_INS_TABLE_
USER_
TABLES
;
return
TSDB_INS_TABLE_TABLES
;
case
QUERY_NODE_SHOW_TAGS_STMT
:
return
TSDB_INS_TABLE_
USER_
TAGS
;
return
TSDB_INS_TABLE_TAGS
;
case
QUERY_NODE_SHOW_STABLES_STMT
:
return
TSDB_INS_TABLE_
USER_
STABLES
;
return
TSDB_INS_TABLE_STABLES
;
case
QUERY_NODE_SHOW_USERS_STMT
:
return
TSDB_INS_TABLE_USER
_USER
S
;
return
TSDB_INS_TABLE_USERS
;
case
QUERY_NODE_SHOW_DNODES_STMT
:
return
TSDB_INS_TABLE_DNODES
;
case
QUERY_NODE_SHOW_VGROUPS_STMT
:
...
...
@@ -5249,9 +5249,9 @@ static const char* getSysTableName(ENodeType type) {
case
QUERY_NODE_SHOW_QNODES_STMT
:
return
TSDB_INS_TABLE_QNODES
;
case
QUERY_NODE_SHOW_FUNCTIONS_STMT
:
return
TSDB_INS_TABLE_
USER_
FUNCTIONS
;
return
TSDB_INS_TABLE_FUNCTIONS
;
case
QUERY_NODE_SHOW_INDEXES_STMT
:
return
TSDB_INS_TABLE_
USER_
INDEXES
;
return
TSDB_INS_TABLE_INDEXES
;
case
QUERY_NODE_SHOW_STREAMS_STMT
:
return
TSDB_PERFS_TABLE_STREAMS
;
case
QUERY_NODE_SHOW_BNODES_STMT
:
...
...
source/libs/parser/test/mockCatalog.cpp
浏览文件 @
cc3a7375
...
...
@@ -58,46 +58,46 @@ void generateInformationSchema(MockCatalogService* mcs) {
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
DATABASES
,
TSDB_SYSTEM_TABLE
,
1
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_DATABASES
,
TSDB_SYSTEM_TABLE
,
1
)
.
addColumn
(
"name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
);
builder
.
done
();
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
FUNCTIONS
,
TSDB_SYSTEM_TABLE
,
1
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_FUNCTIONS
,
TSDB_SYSTEM_TABLE
,
1
)
.
addColumn
(
"name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_FUNC_NAME_LEN
);
builder
.
done
();
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
INDEXES
,
TSDB_SYSTEM_TABLE
,
2
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_INDEXES
,
TSDB_SYSTEM_TABLE
,
2
)
.
addColumn
(
"db_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
)
.
addColumn
(
"table_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_TABLE_NAME_LEN
);
builder
.
done
();
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
STABLES
,
TSDB_SYSTEM_TABLE
,
2
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_STABLES
,
TSDB_SYSTEM_TABLE
,
2
)
.
addColumn
(
"db_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
)
.
addColumn
(
"stable_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_TABLE_NAME_LEN
);
builder
.
done
();
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
TABLES
,
TSDB_SYSTEM_TABLE
,
2
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_TABLES
,
TSDB_SYSTEM_TABLE
,
2
)
.
addColumn
(
"db_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
)
.
addColumn
(
"table_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_TABLE_NAME_LEN
);
builder
.
done
();
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_
USER_
TABLE_DISTRIBUTED
,
TSDB_SYSTEM_TABLE
,
1
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_TABLE_DISTRIBUTED
,
TSDB_SYSTEM_TABLE
,
1
)
.
addColumn
(
"db_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
);
builder
.
done
();
}
{
ITableBuilder
&
builder
=
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_USER
_USER
S
,
TSDB_SYSTEM_TABLE
,
1
)
mcs
->
createTableBuilder
(
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_USERS
,
TSDB_SYSTEM_TABLE
,
1
)
.
addColumn
(
"user_name"
,
TSDB_DATA_TYPE_BINARY
,
TSDB_USER_LEN
);
builder
.
done
();
}
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
cc3a7375
...
...
@@ -568,9 +568,9 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan*
pScan
->
showRewrite
=
pScanLogicNode
->
showRewrite
;
pScan
->
accountId
=
pCxt
->
pPlanCxt
->
acctId
;
if
(
0
==
strcmp
(
pScanLogicNode
->
tableName
.
tname
,
TSDB_INS_TABLE_
USER_
TABLES
)
||
0
==
strcmp
(
pScanLogicNode
->
tableName
.
tname
,
TSDB_INS_TABLE_
USER_
TABLE_DISTRIBUTED
)
||
0
==
strcmp
(
pScanLogicNode
->
tableName
.
tname
,
TSDB_INS_TABLE_
USER_
TAGS
))
{
if
(
0
==
strcmp
(
pScanLogicNode
->
tableName
.
tname
,
TSDB_INS_TABLE_TABLES
)
||
0
==
strcmp
(
pScanLogicNode
->
tableName
.
tname
,
TSDB_INS_TABLE_TABLE_DISTRIBUTED
)
||
0
==
strcmp
(
pScanLogicNode
->
tableName
.
tname
,
TSDB_INS_TABLE_TAGS
))
{
vgroupInfoToNodeAddr
(
pScanLogicNode
->
pVgroupList
->
vgroups
,
&
pSubplan
->
execNode
);
}
else
{
pSubplan
->
execNode
.
nodeId
=
MNODE_HANDLE
;
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
cc3a7375
...
...
@@ -380,6 +380,7 @@ int32_t schDumpJobExecRes(SSchJob* pJob, SExecResult* pRes) {
pRes
->
numOfRows
=
pJob
->
resNumOfRows
;
pRes
->
res
=
pJob
->
execRes
.
res
;
pRes
->
msgType
=
pJob
->
execRes
.
msgType
;
pRes
->
numOfBytes
=
pJob
->
execRes
.
numOfBytes
;
pJob
->
execRes
.
res
=
NULL
;
SCH_JOB_DLOG
(
"execRes dumped, code: %s"
,
tstrerror
(
pRes
->
code
));
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
cc3a7375
...
...
@@ -213,6 +213,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
pJob
->
execRes
.
res
=
rsp
;
pJob
->
execRes
.
msgType
=
TDMT_VND_SUBMIT
;
}
pJob
->
execRes
.
numOfBytes
+=
pTask
->
msgLen
;
SCH_UNLOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
}
...
...
tests/script/tsim/query/explain.sim
浏览文件 @
cc3a7375
...
...
@@ -35,7 +35,7 @@ sql explain select * from st1 where -2;
sql explain select ts from tb1;
sql explain select * from st1;
sql explain select * from st1 order by ts;
sql explain select * from information_schema.
user
_stables;
sql explain select * from information_schema.
ins
_stables;
sql explain select count(*),sum(f1) from tb1;
sql explain select count(*),sum(f1) from st1;
sql explain select count(*),sum(f1) from st1 group by f1;
...
...
@@ -46,7 +46,7 @@ sql explain verbose true select * from st1 where -2;
sql explain verbose true select ts from tb1 where f1 > 0;
sql explain verbose true select * from st1 where f1 > 0 and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00';
sql explain verbose true select count(*) from st1 partition by tbname slimit 1 soffset 2 limit 2 offset 1;
sql explain verbose true select * from information_schema.
user
_stables where db_name='db2';
sql explain verbose true select * from information_schema.
ins
_stables where db_name='db2';
print ======== step4
sql explain analyze select ts from st1 where -2;
...
...
@@ -54,7 +54,7 @@ sql explain analyze select ts from tb1;
sql explain analyze select ts from st1;
sql explain analyze select ts from st1;
sql explain analyze select ts from st1 order by ts;
sql explain analyze select * from information_schema.
user
_stables;
sql explain analyze select * from information_schema.
ins
_stables;
sql explain analyze select count(*),sum(f1) from tb1;
sql explain analyze select count(*),sum(f1) from st1;
sql explain analyze select count(*),sum(f1) from st1 group by f1;
...
...
@@ -65,14 +65,14 @@ sql explain analyze verbose true select ts from tb1;
sql explain analyze verbose true select ts from st1;
sql explain analyze verbose true select ts from st1;
sql explain analyze verbose true select ts from st1 order by ts;
sql explain analyze verbose true select * from information_schema.
user
_stables;
sql explain analyze verbose true select * from information_schema.
ins
_stables;
sql explain analyze verbose true select count(*),sum(f1) from tb1;
sql explain analyze verbose true select count(*),sum(f1) from st1;
sql explain analyze verbose true select count(*),sum(f1) from st1 group by f1;
#sql explain analyze verbose true select count(f1) from tb1 interval(10s, 2s) sliding(3s) fill(prev);
sql explain analyze verbose true select ts from tb1 where f1 > 0;
sql explain analyze verbose true select f1 from st1 where f1 > 0 and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00';
sql explain analyze verbose true select * from information_schema.
user
_stables where db_name='db2';
sql explain analyze verbose true select * from information_schema.
ins
_stables where db_name='db2';
sql explain analyze verbose true select * from (select min(f1),count(*) a from st1 where f1 > 0) where a < 0;
#not pass case
...
...
tests/script/tsim/show/basic.sim
浏览文件 @
cc3a7375
...
...
@@ -77,37 +77,37 @@ if $rows != 3 then
endi
print =============== run select * from information_schema.xxxx
sql select * from information_schema.
`dnodes`
sql select * from information_schema.
ins_dnodes
if $rows != 2 then
return -1
endi
sql select * from information_schema.
`mnodes`
sql select * from information_schema.
ins_mnodes
if $rows != 1 then
return -1
endi
#sql select * from information_schema.
`modules`
#sql select * from information_schema.
`qnodes`
sql select * from information_schema.
user
_databases
#sql select * from information_schema.
ins_modules
#sql select * from information_schema.
ins_qnodes
sql select * from information_schema.
ins
_databases
if $rows != 3 then
return -1
endi
#sql select * from information_schema.
user
_functions
#sql select * from information_schema.
user
_indexes
sql select * from information_schema.
user
_stables
#sql select * from information_schema.
ins
_functions
#sql select * from information_schema.
ins
_indexes
sql select * from information_schema.
ins
_stables
if $rows != 1 then
return -1
endi
#sql select * from information_schema.
`streams`
sql select * from information_schema.
user
_tables
#sql select * from information_schema.
ins_streams
sql select * from information_schema.
ins
_tables
if $rows <= 0 then
return -1
endi
#sql select * from information_schema.
user
_table_distributed
sql select * from information_schema.
user
_users
#sql select * from information_schema.
ins
_table_distributed
sql select * from information_schema.
ins
_users
if $rows != 1 then
return -1
endi
sql select * from information_schema.
`vgroups`
sql select * from information_schema.
ins_vgroups
if $rows != 3 then
return -1
endi
...
...
@@ -175,37 +175,37 @@ if $rows != 3 then
endi
print =============== run select * from information_schema.xxxx
sql select * from information_schema.
`dnodes`
sql select * from information_schema.
ins_dnodes
if $rows != 2 then
return -1
endi
sql select * from information_schema.
`mnodes`
sql select * from information_schema.
ins_mnodes
if $rows != 1 then
return -1
endi
#sql select * from information_schema.
`modules`
#sql select * from information_schema.
`qnodes`
sql select * from information_schema.
user
_databases
#sql select * from information_schema.
ins_modules
#sql select * from information_schema.
ins_qnodes
sql select * from information_schema.
ins
_databases
if $rows != 3 then
return -1
endi
#sql select * from information_schema.
user
_functions
#sql select * from information_schema.
user
_indexes
sql select * from information_schema.
user
_stables
#sql select * from information_schema.
ins
_functions
#sql select * from information_schema.
ins
_indexes
sql select * from information_schema.
ins
_stables
if $rows != 1 then
return -1
endi
#sql select * from performance_schema.
`streams`
sql select * from information_schema.
user
_tables
#sql select * from performance_schema.
perf_streams
sql select * from information_schema.
ins
_tables
if $rows <= 0 then
return -1
endi
#sql select * from information_schema.
user
_table_distributed
sql select * from information_schema.
user
_users
#sql select * from information_schema.
ins
_table_distributed
sql select * from information_schema.
ins
_users
if $rows != 1 then
return -1
endi
sql select * from information_schema.
`vgroups`
sql select * from information_schema.
ins_vgroups
if $rows != 3 then
return -1
endi
...
...
tests/script/tsim/tmq/basic2Of2ConsOverlap.sim
浏览文件 @
cc3a7375
...
...
@@ -342,12 +342,12 @@ endi
return -1
check_ok_3:
sql select * from performance_schema.
`consumers`
sql select * from performance_schema.
perf_consumers
if $rows != 0 then
return -1
endi
#sql select * from performance_schema.
`subscriptions`
#sql select * from performance_schema.
perf_subscriptions
#if $rows != 0 then
# return -1
#endi
...
...
tests/script/tsim/tmq/snapshot1.sim
浏览文件 @
cc3a7375
...
...
@@ -294,12 +294,12 @@ endi
return -1
check_ok_3:
sql select * from performance_schema.
`consumers`
sql select * from performance_schema.
perf_consumers
if $rows != 0 then
return -1
endi
#sql select * from performance_schema.
`subscriptions`
#sql select * from performance_schema.
perf_subscriptions
#if $rows != 0 then
# return -1
#endi
...
...
tests/script/tsim/valgrind/checkError1.sim
浏览文件 @
cc3a7375
...
...
@@ -84,37 +84,37 @@ if $rows != 1 then
endi
print =============== run select * from information_schema.xxxx
sql select * from information_schema.
`dnodes`
sql select * from information_schema.
ins_dnodes
if $rows != 2 then
return -1
endi
sql select * from information_schema.
`mnodes`
sql select * from information_schema.
ins_mnodes
if $rows != 1 then
return -1
endi
sql select * from information_schema.
user
_databases
sql select * from information_schema.
ins
_databases
if $rows != 3 then
return -1
endi
sql select * from information_schema.
user
_stables
sql select * from information_schema.
ins
_stables
if $rows != 1 then
return -1
endi
sql select * from information_schema.
user
_tables
sql select * from information_schema.
ins
_tables
if $rows <= 0 then
return -1
endi
sql select * from information_schema.
user
_users
sql select * from information_schema.
ins
_users
if $rows != 1 then
return -1
endi
sql select * from information_schema.
`vgroups`
sql select * from information_schema.
ins_vgroups
if $rows != 3 then
return -1
endi
...
...
tests/script/tsim/valgrind/checkError6.sim
浏览文件 @
cc3a7375
...
...
@@ -109,12 +109,12 @@ print =============== step5: explain
sql explain analyze select ts from stb where -2;
sql explain analyze select ts from tb1;
sql explain analyze select ts from stb order by ts;
sql explain analyze select * from information_schema.
user
_stables;
sql explain analyze select * from information_schema.
ins
_stables;
sql explain analyze select count(*),sum(tbcol) from tb1;
sql explain analyze select count(*),sum(tbcol) from stb;
sql explain analyze select count(*),sum(tbcol) from stb group by tbcol;
sql explain analyze select * from information_schema.
user
_stables;
sql explain analyze verbose true select * from information_schema.
user
_stables where db_name='db2';
sql explain analyze select * from information_schema.
ins
_stables;
sql explain analyze verbose true select * from information_schema.
ins
_stables where db_name='db2';
sql explain analyze verbose true select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)
sql explain select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录