Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
8e135b15
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看板
提交
8e135b15
编写于
7月 02, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]suppress code check error.
上级
5b4775d9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
13 deletion
+23
-13
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+4
-3
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-0
src/common/src/tname.c
src/common/src/tname.c
+1
-1
src/common/src/tvariant.c
src/common/src/tvariant.c
+4
-2
src/inc/ttype.h
src/inc/ttype.h
+1
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+10
-4
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+2
-2
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
8e135b15
...
...
@@ -1197,16 +1197,17 @@ int32_t tscSetTableFullName(SName* pName, SStrToken* pTableName, SSqlObj* pSql)
}
else
{
// get current DB name first, and then set it into path
char
*
t
=
cloneCurrentDBName
(
pSql
);
if
(
strlen
(
t
)
==
0
)
{
tfree
(
t
);
return
TSDB_CODE_TSC_DB_NOT_SELECTED
;
}
code
=
tNameFromString
(
pName
,
t
,
T_NAME_ACCT
|
T_NAME_DB
);
if
(
code
!=
0
)
{
free
(
t
);
t
free
(
t
);
return
TSDB_CODE_TSC_DB_NOT_SELECTED
;
}
free
(
t
);
t
free
(
t
);
if
(
pTableName
->
n
>=
TSDB_TABLE_NAME_LEN
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
...
...
@@ -6943,7 +6944,7 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
if
(
strncmp
(
sToken
->
z
,
pTagSchema
[
t
].
name
,
sToken
->
n
)
==
0
&&
strlen
(
pTagSchema
[
t
].
name
)
==
sToken
->
n
)
{
SSchema
*
pSchema
=
&
pTagSchema
[
t
];
char
tagVal
[
TSDB_MAX_TAGS_LEN
];
char
tagVal
[
TSDB_MAX_TAGS_LEN
]
=
{
0
}
;
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_BINARY
||
pSchema
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pItem
->
pVar
.
nLen
>
pSchema
->
bytes
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
8e135b15
...
...
@@ -2450,6 +2450,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
if
(
ret
!=
0
)
{
pRes
->
code
=
ret
;
tscAsyncResultOnError
(
pSql
);
tfree
(
pDesc
);
tfree
(
pMemoryBuf
);
return
ret
;
}
...
...
src/common/src/tname.c
浏览文件 @
8e135b15
...
...
@@ -256,7 +256,7 @@ int32_t tNameExtractFullName(const SName* name, char* dst) {
return
-
1
;
}
int32_t
len
=
snprintf
(
dst
,
TSDB_ACCT_ID_LEN
+
1
+
TSDB_DB_NAME_LEN
,
"%s.%s"
,
name
->
acctId
,
name
->
dbname
);
int32_t
len
=
snprintf
(
dst
,
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
,
"%s.%s"
,
name
->
acctId
,
name
->
dbname
);
size_t
tnameLen
=
strlen
(
name
->
tname
);
if
(
tnameLen
>
0
)
{
...
...
src/common/src/tvariant.c
浏览文件 @
8e135b15
...
...
@@ -407,6 +407,7 @@ static int32_t toNchar(tVariant *pVariant, char **pDest, int32_t *pDestSize) {
wchar_t
*
pWStr
=
calloc
(
1
,
(
nLen
+
1
)
*
TSDB_NCHAR_SIZE
);
bool
ret
=
taosMbsToUcs4
(
pDst
,
nLen
,
(
char
*
)
pWStr
,
(
nLen
+
1
)
*
TSDB_NCHAR_SIZE
,
NULL
);
if
(
!
ret
)
{
tfree
(
pWStr
);
return
-
1
;
}
...
...
@@ -606,7 +607,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
}
errno
=
0
;
// reset global error code
int64_t
result
;
int64_t
result
=
0
;
switch
(
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
{
...
...
@@ -874,7 +875,8 @@ int32_t tVariantTypeSetType(tVariant *pVariant, char type) {
free
(
pVariant
->
pz
);
pVariant
->
dKey
=
v
;
}
else
if
(
pVariant
->
nType
>=
TSDB_DATA_TYPE_BOOL
&&
pVariant
->
nType
<=
TSDB_DATA_TYPE_BIGINT
)
{
pVariant
->
dKey
=
(
double
)(
pVariant
->
i64
);
double
tmp
=
(
double
)
pVariant
->
i64
;
pVariant
->
dKey
=
tmp
;
}
pVariant
->
nType
=
TSDB_DATA_TYPE_DOUBLE
;
...
...
src/inc/ttype.h
浏览文件 @
8e135b15
...
...
@@ -119,7 +119,7 @@ typedef struct tstr {
#define IS_VALID_UTINYINT(_t) ((_t) >= 0 && (_t) < UINT8_MAX)
#define IS_VALID_USMALLINT(_t) ((_t) >= 0 && (_t) < UINT16_MAX)
#define IS_VALID_UINT(_t) ((_t) >= 0 && (_t) < UINT32_MAX)
#define IS_VALID_UBIGINT(_t) ((_t) >= 0
&& (_t) < UINT64_MAX
)
#define IS_VALID_UBIGINT(_t) ((_t) >= 0
/*&& (_t) < UINT64_MAX*/
)
static
FORCE_INLINE
bool
isNull
(
const
char
*
val
,
int32_t
type
)
{
switch
(
type
)
{
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
8e135b15
...
...
@@ -1058,7 +1058,7 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_TOO_MANY_COLUMNS
;
}
SSTableObj
*
pStable
=
calloc
(
1
,
sizeof
(
SSTableObj
));
SSTableObj
*
pStable
=
calloc
(
1
,
sizeof
(
SSTableObj
));
if
(
pStable
==
NULL
)
{
mError
(
"msg:%p, app:%p table:%s, failed to create, no enough memory"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableName
);
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
...
...
@@ -1068,8 +1068,10 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
pStable
->
info
.
tableId
=
strdup
(
pCreate
->
tableName
);
pStable
->
info
.
type
=
TSDB_SUPER_TABLE
;
pStable
->
createdTime
=
taosGetTimestampMs
();
uint64_t
x
=
(
us
&
0x000000FFFFFFFFFF
);
x
=
x
<<
24
;
uint64_t
x
=
(
us
&
((
1ul
<<
40
)
-
1
));
// todo refactor
x
=
x
<<
24
;
pStable
->
uid
=
x
+
((
sdbGetVersion
()
&
((
1ul
<<
16
)
-
1ul
))
<<
8
)
+
(
taosRand
()
&
((
1ul
<<
8
)
-
1ul
));
pStable
->
sversion
=
0
;
pStable
->
tversion
=
0
;
...
...
@@ -1079,7 +1081,8 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
int32_t
schemaSize
=
numOfCols
*
sizeof
(
SSchema
);
pStable
->
schema
=
(
SSchema
*
)
calloc
(
1
,
schemaSize
);
if
(
pStable
->
schema
==
NULL
)
{
free
(
pStable
);
tfree
(
pStable
->
info
.
tableId
);
tfree
(
pStable
);
mError
(
"msg:%p, app:%p table:%s, failed to create, no schema input"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableName
);
return
TSDB_CODE_MND_INVALID_TABLE_NAME
;
}
...
...
@@ -1096,6 +1099,9 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
if
(
!
tIsValidSchema
(
pStable
->
schema
,
pStable
->
numOfColumns
,
pStable
->
numOfTags
))
{
mError
(
"msg:%p, app:%p table:%s, failed to create table, invalid schema"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableName
);
tfree
(
pStable
->
info
.
tableId
);
tfree
(
pStable
->
schema
);
tfree
(
pStable
);
return
TSDB_CODE_MND_INVALID_CREATE_TABLE_MSG
;
}
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
8e135b15
...
...
@@ -488,6 +488,7 @@ TsdbQueryHandleT* tsdbQueryTables(STsdbRepo* tsdb, STsdbQueryCond* pCond, STable
pQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromTableGroup
(
pQueryHandle
,
groupList
,
pMeta
,
&
psTable
);
if
(
pQueryHandle
->
pTableCheckInfo
==
NULL
)
{
tsdbCleanupQueryHandle
(
pQueryHandle
);
taosArrayDestroy
(
psTable
);
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
NULL
;
}
...
...
@@ -575,8 +576,6 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon
pQueryHandle
->
next
=
doFreeColumnInfoData
(
pQueryHandle
->
next
);
}
TsdbQueryHandleT
tsdbQueryLastRow
(
STsdbRepo
*
tsdb
,
STsdbQueryCond
*
pCond
,
STableGroupInfo
*
groupList
,
uint64_t
qId
,
SMemRef
*
pMemRef
)
{
pCond
->
twindow
=
updateLastrowForEachGroup
(
groupList
);
...
...
@@ -2874,6 +2873,7 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
SArray
*
psTable
=
NULL
;
pSecQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromCheckInfo
(
pCurrent
,
pSecQueryHandle
->
window
.
skey
,
&
psTable
);
if
(
pSecQueryHandle
->
pTableCheckInfo
==
NULL
)
{
taosArrayDestroy
(
psTable
);
terrno
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
goto
out_of_memory
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录