Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
76154f58
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看板
提交
76154f58
编写于
12月 28, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] support create child table.
上级
55ee57ec
变更
28
展开全部
隐藏空白更改
内联
并排
Showing
28 changed file
with
806 addition
and
746 deletion
+806
-746
include/common/tep.h
include/common/tep.h
+1
-0
include/common/tmsg.h
include/common/tmsg.h
+8
-8
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+2
-2
include/libs/parser/parsenodes.h
include/libs/parser/parsenodes.h
+2
-0
include/libs/parser/parser.h
include/libs/parser/parser.h
+1
-3
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-1
include/util/tdef.h
include/util/tdef.h
+9
-9
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+10
-10
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+13
-11
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+1
-1
source/common/src/tep.c
source/common/src/tep.c
+9
-0
source/common/src/tname.c
source/common/src/tname.c
+4
-5
source/dnode/mgmt/impl/src/dndVnodes.c
source/dnode/mgmt/impl/src/dndVnodes.c
+3
-3
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+6
-6
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+5
-5
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+1
-1
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+1
-1
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+3
-3
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+3
-3
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+5
-5
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+3
-3
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+9
-0
source/libs/parser/inc/ttokendef.h
source/libs/parser/inc/ttokendef.h
+1
-0
source/libs/parser/src/dCDAstProcess.c
source/libs/parser/src/dCDAstProcess.c
+7
-0
source/libs/parser/src/insertParser.c
source/libs/parser/src/insertParser.c
+4
-4
source/libs/parser/src/parserUtil.c
source/libs/parser/src/parserUtil.c
+1
-1
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+692
-660
source/libs/parser/src/ttokenizer.c
source/libs/parser/src/ttokenizer.c
+1
-1
未找到文件。
include/common/tep.h
浏览文件 @
76154f58
...
...
@@ -13,5 +13,6 @@ int taosGetFqdnPortFromEp(const char *ep, char *fqdn, uint16_t *port);
bool
isEpsetEqual
(
const
SEpSet
*
s1
,
const
SEpSet
*
s2
);
void
updateEpSet_s
(
SCorEpSet
*
pEpSet
,
SEpSet
*
pNewEpSet
);
SEpSet
getEpSet_s
(
SCorEpSet
*
pEpSet
);
#endif // TDENGINE_TEP_H
include/common/tmsg.h
浏览文件 @
76154f58
...
...
@@ -371,7 +371,7 @@ typedef struct SColIndex {
int16_t
colId
;
// column id
int16_t
colIndex
;
// column index in colList if it is a normal column or index in tagColList if a tag
int16_t
flag
;
// denote if it is a tag or a normal column
char
name
[
TSDB_
COL_NAME_LEN
+
TSDB_DB_NAME_LEN
+
1
];
char
name
[
TSDB_
DB_FNAME_LEN
];
}
SColIndex
;
typedef
struct
SColumnFilterInfo
{
...
...
@@ -518,7 +518,7 @@ typedef struct SRetrieveTableRsp {
}
SRetrieveTableRsp
;
typedef
struct
{
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int32_t
numOfVgroups
;
int32_t
cacheBlockSize
;
// MB
int32_t
totalBlocks
;
...
...
@@ -542,7 +542,7 @@ typedef struct {
}
SCreateDbMsg
;
typedef
struct
{
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int32_t
totalBlocks
;
int32_t
daysToKeep0
;
int32_t
daysToKeep1
;
...
...
@@ -692,7 +692,7 @@ typedef struct {
typedef
struct
{
int32_t
vgId
;
int32_t
dnodeId
;
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
uint64_t
dbUid
;
int32_t
vgVersion
;
int32_t
cacheBlockSize
;
...
...
@@ -719,7 +719,7 @@ typedef struct {
typedef
struct
{
int32_t
vgId
;
int32_t
dnodeId
;
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
uint64_t
dbUid
;
}
SDropVnodeMsg
,
SSyncVnodeMsg
,
SCompactVnodeMsg
;
...
...
@@ -795,7 +795,7 @@ typedef struct {
}
STagData
;
typedef
struct
{
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int32_t
vgVersion
;
int32_t
vgNum
;
int8_t
hashMethod
;
...
...
@@ -809,13 +809,13 @@ typedef struct {
*/
typedef
struct
{
int8_t
type
;
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int16_t
payloadLen
;
char
payload
[];
}
SShowMsg
;
typedef
struct
{
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int32_t
numOfVgroup
;
int32_t
vgid
[];
}
SCompactMsg
;
...
...
include/libs/catalog/catalog.h
浏览文件 @
76154f58
...
...
@@ -67,14 +67,14 @@ int32_t catalogUpdateDBVgroupCache(struct SCatalog* pCatalog, const char* dbName
/**
* Get a table's meta data.
* @param pCatalog (input, got with catalogGetHandle)
* @param p
Rpc
(input, rpc object)
* @param p
Transporter
(input, rpc object)
* @param pMgmtEps (input, mnode EPs)
* @param pDBName (input, full db name)
* @param pTableName (input, table name, NOT including db name)
* @param pTableMeta(output, table meta data, NEED to free it by calller)
* @return error code
*/
int32_t
catalogGetTableMeta
(
struct
SCatalog
*
pCatalog
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
STableMeta
**
pTableMeta
);
int32_t
catalogGetTableMeta
(
struct
SCatalog
*
pCatalog
,
void
*
pTransporter
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
STableMeta
**
pTableMeta
);
/**
* Force renew a table's local cached meta data.
...
...
include/libs/parser/parsenodes.h
浏览文件 @
76154f58
...
...
@@ -47,6 +47,8 @@ typedef struct SParseBasicCtx {
const
char
*
db
;
int32_t
acctId
;
uint64_t
requestId
;
void
*
pTransporter
;
SEpSet
mgmtEpSet
;
}
SParseBasicCtx
;
typedef
struct
SFieldInfo
{
...
...
include/libs/parser/parser.h
浏览文件 @
76154f58
...
...
@@ -23,10 +23,8 @@ extern "C" {
#include "parsenodes.h"
typedef
struct
SParseContext
{
SParseBasicCtx
ctx
;
void
*
pRpc
;
SParseBasicCtx
ctx
;
struct
SCatalog
*
pCatalog
;
const
SEpSet
*
pEpSet
;
int8_t
schemaAttached
;
// denote if submit block is built with table schema or not
const
char
*
pSql
;
// sql string
size_t
sqlLen
;
// length of the sql string
...
...
include/libs/qcom/query.h
浏览文件 @
76154f58
...
...
@@ -81,7 +81,7 @@ typedef struct SDBVgroupInfo {
}
SDBVgroupInfo
;
typedef
struct
SUseDbOutput
{
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
SDBVgroupInfo
dbVgroup
;
}
SUseDbOutput
;
...
...
include/util/tdef.h
浏览文件 @
76154f58
...
...
@@ -149,7 +149,7 @@ do { \
#define IS_RELATION_OPTR(op) (((op) >= TSDB_RELATION_LESS) && ((op) < TSDB_RELATION_IN))
#define IS_ARITHMETIC_OPTR(op) (((op) >= TSDB_BINARY_OP_ADD) && ((op) <= TSDB_BINARY_OP_REMAINDER))
#define TS
_PATH_DELIMITER_LEN
1
#define TS
DB_NAME_DELIMITER_LEN
1
#define TSDB_UNI_LEN 24
#define TSDB_USER_LEN TSDB_UNI_LEN
...
...
@@ -165,17 +165,17 @@ do { \
#define TSDB_TABLE_NAME_LEN 193 // it is a null-terminated string
#define TSDB_TOPIC_NAME_LEN 193 // it is a null-terminated string
#define TSDB_DB_NAME_LEN 65
#define TSDB_
FULL_DB_NAME_LEN (TSDB_ACCT_ID_LEN + TSDB_DB_NAME
_LEN)
#define TSDB_
DB_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_DB_NAME_LEN + TSDB_NAME_DELIMITER
_LEN)
#define TSDB_FUNC_NAME_LEN
65
#define TSDB_FUNC_COMMENT_LEN
4096
#define TSDB_FUNC_CODE_LEN
(65535 - 512)
#define TSDB_FUNC_BUF_SIZE
512
#define TSDB_FUNC_TYPE_SCALAR
1
#define TSDB_FUNC_TYPE_AGGREGATE
2
#define TSDB_FUNC_NAME_LEN 65
#define TSDB_FUNC_COMMENT_LEN 4096
#define TSDB_FUNC_CODE_LEN (65535 - 512)
#define TSDB_FUNC_BUF_SIZE 512
#define TSDB_FUNC_TYPE_SCALAR 1
#define TSDB_FUNC_TYPE_AGGREGATE 2
#define TSDB_TYPE_STR_MAX_LEN 32
#define TSDB_TABLE_FNAME_LEN (TSDB_
FULL_DB_NAME_LEN + TSDB_TABLE_NAME
_LEN)
#define TSDB_TABLE_FNAME_LEN (TSDB_
DB_FNAME_LEN + TSDB_TABLE_NAME_LEN + TSDB_NAME_DELIMITER
_LEN)
#define TSDB_TOPIC_FNAME_LEN TSDB_TABLE_FNAME_LEN
#define TSDB_COL_NAME_LEN 65
#define TSDB_MAX_SAVED_SQL_LEN TSDB_MAX_COLUMNS * 64
...
...
source/client/inc/clientInt.h
浏览文件 @
76154f58
...
...
@@ -75,16 +75,16 @@ typedef struct SAppInfo {
}
SAppInfo
;
typedef
struct
STscObj
{
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_
NAME_LEN
];
int32_t
acctId
;
uint32_t
connId
;
uint64_t
id
;
// ref ID returned by taosAddRef
void
*
pTransporter
;
pthread_mutex_t
mutex
;
// used to protect the operation on db
int32_t
numOfReqs
;
// number of sqlObj from this tscObj
SAppInstInfo
*
pAppInfo
;
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
db
[
TSDB_DB_F
NAME_LEN
];
int32_t
acctId
;
uint32_t
connId
;
uint64_t
id
;
// ref ID returned by taosAddRef
void
*
pTransporter
;
pthread_mutex_t
mutex
;
// used to protect the operation on db
int32_t
numOfReqs
;
// number of sqlObj from this tscObj
SAppInstInfo
*
pAppInfo
;
}
STscObj
;
typedef
struct
SReqResultInfo
{
...
...
source/client/src/clientImpl.c
浏览文件 @
76154f58
...
...
@@ -146,13 +146,15 @@ int32_t buildRequest(STscObj *pTscObj, const char *sql, int sqlLen, SRequestObj*
int32_t
parseSql
(
SRequestObj
*
pRequest
,
SQueryNode
**
pQuery
)
{
SParseContext
cxt
=
{
.
ctx
=
{.
requestId
=
pRequest
->
requestId
,
.
acctId
=
pRequest
->
pTscObj
->
acctId
,
.
db
=
getConnectionDB
(
pRequest
->
pTscObj
)},
.
pSql
=
pRequest
->
sqlstr
,
.
ctx
=
{.
requestId
=
pRequest
->
requestId
,
.
acctId
=
pRequest
->
pTscObj
->
acctId
,
.
db
=
getConnectionDB
(
pRequest
->
pTscObj
)
,
.
pTransporter
=
pRequest
->
pTscObj
->
pTransporter
},
.
pSql
=
pRequest
->
sqlstr
,
.
sqlLen
=
pRequest
->
sqlLen
,
.
pMsg
=
pRequest
->
msgBuf
,
.
pMsg
=
pRequest
->
msgBuf
,
.
msgLen
=
ERROR_MSG_BUF_DEFAULT_SIZE
};
cxt
.
ctx
.
mgmtEpSet
=
getEpSet_s
(
&
pRequest
->
pTscObj
->
pAppInfo
->
mgmtEp
);
int32_t
code
=
qParseQuerySql
(
&
cxt
,
pQuery
);
tfree
(
cxt
.
ctx
.
db
);
return
code
;
...
...
@@ -165,7 +167,7 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQueryNode* pQuery) {
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SMsgSendInfo
*
body
=
buildSendMsgInfoImpl
(
pRequest
);
SMsgSendInfo
*
pSendMsg
=
buildSendMsgInfoImpl
(
pRequest
);
SEpSet
*
pEpSet
=
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
;
if
(
pDcl
->
msgType
==
TDMT_VND_CREATE_TABLE
)
{
...
...
@@ -178,34 +180,34 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQueryNode* pQuery) {
return
code
;
}
SCreateTableMsg
*
pMsg
=
body
->
msgInfo
.
pData
;
SCreateTableMsg
*
pMsg
=
pSendMsg
->
msgInfo
.
pData
;
SName
t
=
{
0
};
tNameFromString
(
&
t
,
pMsg
->
name
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
char
db
[
TSDB_DB_NAME_LEN
+
TS
_PATH
_DELIMITER_LEN
+
TSDB_ACCT_ID_LEN
]
=
{
0
};
char
db
[
TSDB_DB_NAME_LEN
+
TS
DB_NAME
_DELIMITER_LEN
+
TSDB_ACCT_ID_LEN
]
=
{
0
};
tNameGetFullDbName
(
&
t
,
db
);
SVgroupInfo
info
=
{
0
};
catalogGetTableHashVgroup
(
pCatalog
,
pRequest
->
pTscObj
->
pTransporter
,
pEpSet
,
db
,
tNameGetTableName
(
&
t
),
&
info
);
int64_t
transporterId
=
0
;
SEpSet
ep
=
{
0
};
ep
.
inUse
=
info
.
inUse
;
SEpSet
ep
=
{
0
};
ep
.
inUse
=
info
.
inUse
;
ep
.
numOfEps
=
info
.
numOfEps
;
for
(
int32_t
i
=
0
;
i
<
ep
.
numOfEps
;
++
i
)
{
ep
.
port
[
i
]
=
info
.
epAddr
[
i
].
port
;
tstrncpy
(
ep
.
fqdn
[
i
],
info
.
epAddr
[
i
].
fqdn
,
tListLen
(
ep
.
fqdn
[
i
]));
}
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
&
ep
,
&
transporterId
,
body
);
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
&
ep
,
&
transporterId
,
pSendMsg
);
}
else
{
int64_t
transporterId
=
0
;
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
pEpSet
,
&
transporterId
,
body
);
asyncSendMsgToServer
(
pTscObj
->
pTransporter
,
pEpSet
,
&
transporterId
,
pSendMsg
);
}
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
destroySendMsgInfo
(
body
);
destroySendMsgInfo
(
pSendMsg
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
76154f58
...
...
@@ -139,7 +139,7 @@ int32_t processShowRsp(void* param, const SDataBuf* pMsg, int32_t code) {
pFields
[
i
].
bytes
=
pSchema
[
i
].
bytes
;
}
//
pRequest->body.resInfo.pRspMsg = pMsg->pData;
pRequest
->
body
.
resInfo
.
pRspMsg
=
pMsg
->
pData
;
SReqResultInfo
*
pResInfo
=
&
pRequest
->
body
.
resInfo
;
pResInfo
->
fields
=
pFields
;
...
...
source/common/src/tep.c
浏览文件 @
76154f58
...
...
@@ -39,3 +39,12 @@ void updateEpSet_s(SCorEpSet *pEpSet, SEpSet *pNewEpSet) {
taosCorEndWrite
(
&
pEpSet
->
version
);
}
SEpSet
getEpSet_s
(
SCorEpSet
*
pEpSet
)
{
SEpSet
ep
=
{
0
};
taosCorBeginRead
(
&
pEpSet
->
version
);
ep
=
pEpSet
->
epSet
;
taosCorEndRead
(
&
pEpSet
->
version
);
return
ep
;
}
source/common/src/tname.c
浏览文件 @
76154f58
...
...
@@ -110,7 +110,7 @@ int32_t tNameExtractFullName(const SName* name, char* dst) {
return
-
1
;
}
int32_t
len
=
snprintf
(
dst
,
TSDB_
FULL_DB_
NAME_LEN
,
"%d.%s"
,
name
->
acctId
,
name
->
dbname
);
int32_t
len
=
snprintf
(
dst
,
TSDB_
DB_F
NAME_LEN
,
"%d.%s"
,
name
->
acctId
,
name
->
dbname
);
size_t
tnameLen
=
strlen
(
name
->
tname
);
if
(
tnameLen
>
0
)
{
...
...
@@ -134,10 +134,10 @@ int32_t tNameLen(const SName* name) {
if
(
name
->
type
==
TSDB_DB_NAME_T
)
{
assert
(
len2
==
0
);
return
len
+
len1
+
TS
_PATH
_DELIMITER_LEN
;
return
len
+
len1
+
TS
DB_NAME
_DELIMITER_LEN
;
}
else
{
assert
(
len2
>
0
);
return
len
+
len1
+
len2
+
TS
_PATH
_DELIMITER_LEN
*
2
;
return
len
+
len1
+
len2
+
TS
DB_NAME
_DELIMITER_LEN
*
2
;
}
}
...
...
@@ -171,8 +171,7 @@ int32_t tNameGetDbName(const SName* name, char* dst) {
int32_t
tNameGetFullDbName
(
const
SName
*
name
,
char
*
dst
)
{
assert
(
name
!=
NULL
&&
dst
!=
NULL
);
snprintf
(
dst
,
TSDB_ACCT_ID_LEN
+
TS_PATH_DELIMITER_LEN
+
TSDB_DB_NAME_LEN
,
// there is a over write risk
"%d.%s"
,
name
->
acctId
,
name
->
dbname
);
snprintf
(
dst
,
TSDB_DB_FNAME_LEN
,
"%d.%s"
,
name
->
acctId
,
name
->
dbname
);
return
0
;
}
...
...
source/dnode/mgmt/impl/src/dndVnodes.c
浏览文件 @
76154f58
...
...
@@ -22,7 +22,7 @@ typedef struct {
int32_t
vgVersion
;
int8_t
dropped
;
uint64_t
dbUid
;
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
char
path
[
PATH_MAX
+
20
];
}
SWrapperCfg
;
...
...
@@ -319,7 +319,7 @@ static int32_t dndGetVnodesFromFile(SDnode *pDnode, SWrapperCfg **ppCfgs, int32_
dError
(
"failed to read %s since db not found"
,
file
);
goto
PRASE_VNODE_OVER
;
}
tstrncpy
(
pCfg
->
db
,
db
->
valuestring
,
TSDB_
FULL_DB_
NAME_LEN
);
tstrncpy
(
pCfg
->
db
,
db
->
valuestring
,
TSDB_
DB_F
NAME_LEN
);
}
*
ppCfgs
=
pCfgs
;
...
...
@@ -569,7 +569,7 @@ static void dndGenerateVnodeCfg(SCreateVnodeMsg *pCreate, SVnodeCfg *pCfg) {
}
static
void
dndGenerateWrapperCfg
(
SDnode
*
pDnode
,
SCreateVnodeMsg
*
pCreate
,
SWrapperCfg
*
pCfg
)
{
memcpy
(
pCfg
->
db
,
pCreate
->
db
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
pCfg
->
db
,
pCreate
->
db
,
TSDB_
DB_F
NAME_LEN
);
pCfg
->
dbUid
=
pCreate
->
dbUid
;
pCfg
->
dropped
=
0
;
snprintf
(
pCfg
->
path
,
sizeof
(
pCfg
->
path
),
"%s/vnode%d"
,
pDnode
->
dir
.
vnodes
,
pCreate
->
vgId
);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
76154f58
...
...
@@ -209,7 +209,7 @@ typedef struct {
}
SDbCfg
;
typedef
struct
{
char
name
[
TSDB_
FULL_DB_
NAME_LEN
];
char
name
[
TSDB_
DB_F
NAME_LEN
];
char
acct
[
TSDB_USER_LEN
];
int64_t
createdTime
;
int64_t
updateTime
;
...
...
@@ -232,7 +232,7 @@ typedef struct {
int32_t
version
;
uint32_t
hashBegin
;
uint32_t
hashEnd
;
char
dbName
[
TSDB_
FULL_DB_
NAME_LEN
];
char
dbName
[
TSDB_
DB_F
NAME_LEN
];
int64_t
dbUid
;
int32_t
numOfTables
;
int32_t
numOfTimeSeries
;
...
...
@@ -246,7 +246,7 @@ typedef struct {
typedef
struct
{
char
name
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int64_t
createdTime
;
int64_t
updateTime
;
uint64_t
uid
;
...
...
@@ -286,7 +286,7 @@ typedef struct {
int32_t
payloadLen
;
void
*
pIter
;
SMnode
*
pMnode
;
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int16_t
offset
[
TSDB_MAX_COLUMNS
];
int32_t
bytes
[
TSDB_MAX_COLUMNS
];
char
payload
[];
...
...
@@ -294,7 +294,7 @@ typedef struct {
typedef
struct
{
char
name
[
TSDB_TOPIC_FNAME_LEN
];
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int64_t
createTime
;
int64_t
updateTime
;
uint64_t
uid
;
...
...
@@ -309,7 +309,7 @@ typedef struct {
typedef
struct
SMnodeMsg
{
char
user
[
TSDB_USER_LEN
];
char
db
[
TSDB_
FULL_DB_
NAME_LEN
];
char
db
[
TSDB_
DB_F
NAME_LEN
];
int32_t
acctId
;
SMnode
*
pMnode
;
int64_t
createdTime
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
76154f58
...
...
@@ -69,7 +69,7 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
if
(
pRaw
==
NULL
)
return
NULL
;
int32_t
dataPos
=
0
;
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pDb
->
acct
,
TSDB_USER_LEN
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pDb
->
createdTime
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pDb
->
updateTime
)
...
...
@@ -116,7 +116,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
if
(
pDb
==
NULL
)
return
NULL
;
int32_t
dataPos
=
0
;
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pDb
->
acct
,
TSDB_USER_LEN
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pDb
->
createdTime
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pDb
->
updateTime
)
...
...
@@ -353,11 +353,11 @@ static int32_t mndSetCreateDbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
static
int32_t
mndCreateDb
(
SMnode
*
pMnode
,
SMnodeMsg
*
pMsg
,
SCreateDbMsg
*
pCreate
,
SUserObj
*
pUser
)
{
SDbObj
dbObj
=
{
0
};
memcpy
(
dbObj
.
name
,
pCreate
->
db
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
dbObj
.
name
,
pCreate
->
db
,
TSDB_
DB_F
NAME_LEN
);
memcpy
(
dbObj
.
acct
,
pUser
->
acct
,
TSDB_USER_LEN
);
dbObj
.
createdTime
=
taosGetTimestampMs
();
dbObj
.
updateTime
=
dbObj
.
createdTime
;
dbObj
.
uid
=
mndGenerateUid
(
dbObj
.
name
,
TSDB_
FULL_DB_
NAME_LEN
);
dbObj
.
uid
=
mndGenerateUid
(
dbObj
.
name
,
TSDB_
DB_F
NAME_LEN
);
dbObj
.
cfgVersion
=
1
;
dbObj
.
vgVersion
=
1
;
dbObj
.
hashMethod
=
1
;
...
...
@@ -891,7 +891,7 @@ static int32_t mndProcessUseDbMsg(SMnodeMsg *pMsg) {
}
}
memcpy
(
pRsp
->
db
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
pRsp
->
db
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
);
pRsp
->
vgVersion
=
htonl
(
pDb
->
vgVersion
);
pRsp
->
vgNum
=
htonl
(
vindex
);
pRsp
->
hashMethod
=
pDb
->
hashMethod
;
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
76154f58
...
...
@@ -194,7 +194,7 @@ static int32_t mndProcessConnectMsg(SMnodeMsg *pMsg) {
taosIp2String
(
info
.
clientIp
,
ip
);
if
(
pReq
->
db
[
0
])
{
snprintf
(
pMsg
->
db
,
TSDB_
FULL_DB_
NAME_LEN
,
"%d%s%s"
,
pMsg
->
acctId
,
TS_PATH_DELIMITER
,
pReq
->
db
);
snprintf
(
pMsg
->
db
,
TSDB_
DB_F
NAME_LEN
,
"%d%s%s"
,
pMsg
->
acctId
,
TS_PATH_DELIMITER
,
pReq
->
db
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pMsg
->
db
);
if
(
pDb
==
NULL
)
{
terrno
=
TSDB_CODE_MND_INVALID_DB
;
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
76154f58
...
...
@@ -62,7 +62,7 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SShowMsg *pMsg) {
pShow
->
pMnode
=
pMnode
;
pShow
->
type
=
pMsg
->
type
;
pShow
->
payloadLen
=
pMsg
->
payloadLen
;
memcpy
(
pShow
->
db
,
pMsg
->
db
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
pShow
->
db
,
pMsg
->
db
,
TSDB_
DB_F
NAME_LEN
);
memcpy
(
pShow
->
payload
,
pMsg
->
payload
,
pMsg
->
payloadLen
);
}
else
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
76154f58
...
...
@@ -76,7 +76,7 @@ static SSdbRaw *mndStbActionEncode(SStbObj *pStb) {
int32_t
dataPos
=
0
;
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pStb
->
name
,
TSDB_TABLE_FNAME_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pStb
->
db
,
TSDB_
FULL_DB_
NAME_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pStb
->
db
,
TSDB_
DB_F
NAME_LEN
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pStb
->
createdTime
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pStb
->
updateTime
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pStb
->
uid
)
...
...
@@ -117,7 +117,7 @@ static SSdbRow *mndStbActionDecode(SSdbRaw *pRaw) {
int32_t
dataPos
=
0
;
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pStb
->
name
,
TSDB_TABLE_FNAME_LEN
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pStb
->
db
,
TSDB_
FULL_DB_
NAME_LEN
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pStb
->
db
,
TSDB_
DB_F
NAME_LEN
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pStb
->
createdTime
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pStb
->
updateTime
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pStb
->
uid
)
...
...
@@ -435,7 +435,7 @@ static int32_t mndSetCreateStbUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj
static
int32_t
mndCreateStb
(
SMnode
*
pMnode
,
SMnodeMsg
*
pMsg
,
SCreateStbMsg
*
pCreate
,
SDbObj
*
pDb
)
{
SStbObj
stbObj
=
{
0
};
tstrncpy
(
stbObj
.
name
,
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
tstrncpy
(
stbObj
.
db
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
);
tstrncpy
(
stbObj
.
db
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
);
stbObj
.
createdTime
=
taosGetTimestampMs
();
stbObj
.
updateTime
=
stbObj
.
createdTime
;
stbObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
76154f58
...
...
@@ -79,7 +79,7 @@ static SSdbRaw *mndTopicActionEncode(STopicObj *pTopic) {
int32_t
dataPos
=
0
;
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTopic
->
name
,
TSDB_TABLE_FNAME_LEN
);
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTopic
->
db
,
TSDB_
FULL_DB_
NAME_LEN
);
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTopic
->
db
,
TSDB_
DB_F
NAME_LEN
);
SDB_SET_INT64
(
pRaw
,
dataPos
,
pTopic
->
createTime
);
SDB_SET_INT64
(
pRaw
,
dataPos
,
pTopic
->
updateTime
);
SDB_SET_INT64
(
pRaw
,
dataPos
,
pTopic
->
uid
);
...
...
@@ -113,7 +113,7 @@ static SSdbRow *mndTopicActionDecode(SSdbRaw *pRaw) {
int32_t
dataPos
=
0
;
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pTopic
->
name
,
TSDB_TABLE_FNAME_LEN
);
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pTopic
->
db
,
TSDB_
FULL_DB_
NAME_LEN
);
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pTopic
->
db
,
TSDB_
DB_F
NAME_LEN
);
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pTopic
->
createTime
);
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pTopic
->
updateTime
);
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pTopic
->
uid
);
...
...
@@ -348,7 +348,7 @@ static int32_t mndSetCreateTopicUndoActions(SMnode *pMnode, STrans *pTrans, SDbO
static
int32_t
mndCreateTopic
(
SMnode
*
pMnode
,
SMnodeMsg
*
pMsg
,
SCreateTopicMsg
*
pCreate
,
SDbObj
*
pDb
)
{
STopicObj
topicObj
=
{
0
};
tstrncpy
(
topicObj
.
name
,
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
tstrncpy
(
topicObj
.
db
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
);
tstrncpy
(
topicObj
.
db
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
);
topicObj
.
createTime
=
taosGetTimestampMs
();
topicObj
.
updateTime
=
topicObj
.
createTime
;
topicObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
76154f58
...
...
@@ -80,7 +80,7 @@ SSdbRaw *mndVgroupActionEncode(SVgObj *pVgroup) {
SDB_SET_INT32
(
pRaw
,
dataPos
,
pVgroup
->
version
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pVgroup
->
hashBegin
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pVgroup
->
hashEnd
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pVgroup
->
dbName
,
TSDB_
FULL_DB_
NAME_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pVgroup
->
dbName
,
TSDB_
DB_F
NAME_LEN
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pVgroup
->
dbUid
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pVgroup
->
replica
)
for
(
int8_t
i
=
0
;
i
<
pVgroup
->
replica
;
++
i
)
{
...
...
@@ -115,7 +115,7 @@ SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT32
(
pRaw
,
pRow
,
dataPos
,
&
pVgroup
->
version
)
SDB_GET_INT32
(
pRaw
,
pRow
,
dataPos
,
&
pVgroup
->
hashBegin
)
SDB_GET_INT32
(
pRaw
,
pRow
,
dataPos
,
&
pVgroup
->
hashEnd
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pVgroup
->
dbName
,
TSDB_
FULL_DB_
NAME_LEN
)
SDB_GET_BINARY
(
pRaw
,
pRow
,
dataPos
,
pVgroup
->
dbName
,
TSDB_
DB_F
NAME_LEN
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pVgroup
->
dbUid
)
SDB_GET_INT8
(
pRaw
,
pRow
,
dataPos
,
&
pVgroup
->
replica
)
for
(
int8_t
i
=
0
;
i
<
pVgroup
->
replica
;
++
i
)
{
...
...
@@ -172,7 +172,7 @@ SCreateVnodeMsg *mndBuildCreateVnodeMsg(SMnode *pMnode, SDnodeObj *pDnode, SDbOb
pCreate
->
vgId
=
htonl
(
pVgroup
->
vgId
);
pCreate
->
dnodeId
=
htonl
(
pDnode
->
id
);
memcpy
(
pCreate
->
db
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
pCreate
->
db
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
);
pCreate
->
dbUid
=
htobe64
(
pDb
->
uid
);
pCreate
->
vgVersion
=
htonl
(
pVgroup
->
version
);
pCreate
->
cacheBlockSize
=
htonl
(
pDb
->
cfg
.
cacheBlockSize
);
...
...
@@ -231,7 +231,7 @@ SDropVnodeMsg *mndBuildDropVnodeMsg(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *p
pDrop
->
dnodeId
=
htonl
(
pDnode
->
id
);
pDrop
->
vgId
=
htonl
(
pVgroup
->
vgId
);
memcpy
(
pDrop
->
db
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
pDrop
->
db
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
);
pDrop
->
dbUid
=
htobe64
(
pDb
->
uid
);
return
pDrop
;
...
...
@@ -294,7 +294,7 @@ int32_t mndAllocVgroup(SMnode *pMnode, SDbObj *pDb, SVgObj **ppVgroups) {
pVgroup
->
hashEnd
=
hashMin
+
hashInterval
*
(
v
+
1
)
-
1
;
}
memcpy
(
pVgroup
->
dbName
,
pDb
->
name
,
TSDB_
FULL_DB_
NAME_LEN
);
memcpy
(
pVgroup
->
dbName
,
pDb
->
name
,
TSDB_
DB_F
NAME_LEN
);
pVgroup
->
dbUid
=
pDb
->
uid
;
pVgroup
->
replica
=
pDb
->
cfg
.
replications
;
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
76154f58
...
...
@@ -500,8 +500,8 @@ int32_t catalogGetDBVgroup(struct SCatalog* pCatalog, void *pRpc, const SEpSet*
return
TSDB_CODE_SUCCESS
;
}
int32_t
catalogGetTableMeta
(
struct
SCatalog
*
pCatalog
,
void
*
p
Rpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
STableMeta
**
pTableMeta
)
{
return
ctgGetTableMetaImpl
(
pCatalog
,
p
Rpc
,
pMgmtEps
,
pDBName
,
pTableName
,
false
,
pTableMeta
);
int32_t
catalogGetTableMeta
(
struct
SCatalog
*
pCatalog
,
void
*
p
Transporter
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
STableMeta
**
pTableMeta
)
{
return
ctgGetTableMetaImpl
(
pCatalog
,
p
Transporter
,
pMgmtEps
,
pDBName
,
pTableName
,
false
,
pTableMeta
);
}
int32_t
catalogRenewTableMeta
(
struct
SCatalog
*
pCatalog
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
)
{
...
...
@@ -602,7 +602,7 @@ int32_t catalogGetAllMeta(struct SCatalog* pCatalog, void *pRpc, const SEpSet* p
int32_t
code
=
0
;
if
(
pReq
->
pTableName
)
{
char
dbName
[
TSDB_
FULL_DB_
NAME_LEN
];
char
dbName
[
TSDB_
DB_F
NAME_LEN
];
int32_t
tbNum
=
(
int32_t
)
taosArrayGetSize
(
pReq
->
pTableName
);
if
(
tbNum
>
0
)
{
pRsp
->
pTableMeta
=
taosArrayInit
(
tbNum
,
POINTER_BYTES
);
...
...
source/libs/parser/inc/sql.y
浏览文件 @
76154f58
...
...
@@ -445,6 +445,15 @@ tagitemlist1(A) ::= tagitem1(Y). { A = taosArrayInit(4, sizeof(SToken)); taosArr
%type tagitem1 {SToken}
tagitem1(A) ::= MINUS(X) INTEGER(Y). { A.n = X.n + Y.n; A.type = Y.type; }
tagitem1(A) ::= MINUS(X) FLOAT(Y). { A.n = X.n + Y.n; A.type = Y.type; }
tagitem1(A) ::= PLUS(X) INTEGER(Y). { A.n = X.n + Y.n; A.type = Y.type; }
tagitem1(A) ::= PLUS(X) FLOAT(Y). { A.n = X.n + Y.n; A.type = Y.type; }
tagitem1(A) ::= INTEGER(X). { A = X; }
tagitem1(A) ::= FLOAT(X). { A = X; }
tagitem1(A) ::= STRING(X). { A = X; }
tagitem1(A) ::= BOOL(X). { A = X; }
tagitem1(A) ::= NULL(X). { A = X; }
tagitem1(A) ::= NOW(X). { A = X; }
%type tagitemlist {SArray*}
%destructor tagitemlist {taosArrayDestroy($$);}
...
...
source/libs/parser/inc/ttokendef.h
浏览文件 @
76154f58
...
...
@@ -215,6 +215,7 @@
#define TK_SPACE 300
#define TK_COMMENT 301
#define TK_ILLEGAL 302
...
...
source/libs/parser/src/dCDAstProcess.c
浏览文件 @
76154f58
...
...
@@ -323,6 +323,13 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx *pCtx, SMsgBuf* p
size_t
valSize
=
taosArrayGetSize
(
pValList
);
STableMeta
*
pSuperTableMeta
=
NULL
;
struct
SCatalog
*
pCatalog
=
NULL
;
char
dbName
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
tNameGetFullDbName
(
&
name
,
dbName
);
catalogGetTableMeta
(
pCatalog
,
pCtx
->
pTransporter
,
&
pCtx
->
mgmtEpSet
,
dbName
,
pCreateTableInfo
->
tagdata
.
name
,
&
pSuperTableMeta
);
// too long tag values will return invalid sql, not be truncated automatically
SSchema
*
pTagSchema
=
getTableTagSchema
(
pSuperTableMeta
);
STableComInfo
tinfo
=
getTableInfo
(
pSuperTableMeta
);
...
...
source/libs/parser/src/insertParser.c
浏览文件 @
76154f58
...
...
@@ -162,7 +162,7 @@ static int32_t buildName(SInsertParseContext* pCxt, SToken* pStname, char* fullD
strncpy
(
fullDbName
+
n
,
pStname
->
z
,
p
-
pStname
->
z
);
strncpy
(
tableName
,
p
+
1
,
pStname
->
n
-
(
p
-
pStname
->
z
)
-
1
);
}
else
{
snprintf
(
fullDbName
,
TSDB_
FULL_DB_
NAME_LEN
,
"%d.%s"
,
pCxt
->
pComCxt
->
ctx
.
acctId
,
pCxt
->
pComCxt
->
ctx
.
db
);
snprintf
(
fullDbName
,
TSDB_
DB_F
NAME_LEN
,
"%d.%s"
,
pCxt
->
pComCxt
->
ctx
.
acctId
,
pCxt
->
pComCxt
->
ctx
.
db
);
strncpy
(
tableName
,
pStname
->
z
,
pStname
->
n
);
}
...
...
@@ -170,12 +170,12 @@ static int32_t buildName(SInsertParseContext* pCxt, SToken* pStname, char* fullD
}
static
int32_t
getTableMeta
(
SInsertParseContext
*
pCxt
,
SToken
*
pTname
)
{
char
fullDbName
[
TSDB_
FULL_DB_
NAME_LEN
]
=
{
0
};
char
fullDbName
[
TSDB_
DB_F
NAME_LEN
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
]
=
{
0
};
CHECK_CODE
(
buildName
(
pCxt
,
pTname
,
fullDbName
,
tableName
));
CHECK_CODE
(
catalogGetTableMeta
(
pCxt
->
pComCxt
->
pCatalog
,
pCxt
->
pComCxt
->
pRpc
,
pCxt
->
pComCxt
->
p
EpSet
,
fullDbName
,
tableName
,
&
pCxt
->
pTableMeta
));
CHECK_CODE
(
catalogGetTableMeta
(
pCxt
->
pComCxt
->
pCatalog
,
pCxt
->
pComCxt
->
ctx
.
pTransporter
,
&
pCxt
->
pComCxt
->
ctx
.
mgmt
EpSet
,
fullDbName
,
tableName
,
&
pCxt
->
pTableMeta
));
SVgroupInfo
vg
;
CHECK_CODE
(
catalogGetTableHashVgroup
(
pCxt
->
pComCxt
->
pCatalog
,
pCxt
->
pComCxt
->
pRpc
,
pCxt
->
pComCxt
->
p
EpSet
,
fullDbName
,
tableName
,
&
vg
));
CHECK_CODE
(
catalogGetTableHashVgroup
(
pCxt
->
pComCxt
->
pCatalog
,
pCxt
->
pComCxt
->
ctx
.
pTransporter
,
&
pCxt
->
pComCxt
->
ctx
.
mgmt
EpSet
,
fullDbName
,
tableName
,
&
vg
));
CHECK_CODE
(
taosHashPut
(
pCxt
->
pVgroupsHashObj
,
(
const
char
*
)
&
vg
.
vgId
,
sizeof
(
vg
.
vgId
),
(
char
*
)
&
vg
,
sizeof
(
vg
)));
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/parser/src/parserUtil.c
浏览文件 @
76154f58
...
...
@@ -1918,7 +1918,7 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
case TAOS_REQ_FROM_HTTP:
pCtx = pSql->param;
if (pCtx && pCtx->db[0] != '\0') {
char db[TSDB_
FULL_DB_
NAME_LEN] = {0};
char db[TSDB_
DB_F
NAME_LEN] = {0};
int32_t len = sprintf(db, "%s%s%s", pTscObj->acctId, TS_PATH_DELIMITER, pCtx->db);
assert(len <= sizeof(db));
...
...
source/libs/parser/src/sql.c
浏览文件 @
76154f58
此差异已折叠。
点击以展开。
source/libs/parser/src/ttokenizer.c
浏览文件 @
76154f58
...
...
@@ -672,7 +672,7 @@ SToken tStrGetToken(const char* str, int32_t* i, bool isPrevOptr) {
}
}
t0
.
z
=
str
+
(
*
i
);
t0
.
z
=
(
char
*
)
str
+
(
*
i
);
*
i
+=
t0
.
n
;
return
t0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录