Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
58f2621f
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看板
提交
58f2621f
编写于
7月 16, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code optimization
上级
e6a8f2f7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
16 addition
and
15 deletion
+16
-15
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+3
-3
src/client/src/tscServer.c
src/client/src/tscServer.c
+3
-3
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-2
src/common/src/ttypes.c
src/common/src/ttypes.c
+1
-1
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+1
-1
src/inc/taosdef.h
src/inc/taosdef.h
+3
-2
src/inc/ttype.h
src/inc/ttype.h
+1
-1
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+1
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
58f2621f
...
...
@@ -184,6 +184,7 @@ typedef struct {
uint32_t
allocSize
;
char
*
payload
;
int32_t
payloadLen
;
void
*
pBuf
;
// table meta buffer
SHashObj
*
pTableMetaMap
;
// local buffer to keep the queried table meta, before validating the AST
SQueryInfo
*
pQueryInfo
;
...
...
@@ -273,7 +274,6 @@ typedef struct SSqlObj {
void
*
pStream
;
void
*
pSubscription
;
char
*
sqlstr
;
void
*
pBuf
;
// tableMeta buffer
char
parseRetry
;
char
retry
;
char
maxRetry
;
...
...
src/client/src/tscSQLParser.c
浏览文件 @
58f2621f
...
...
@@ -7697,8 +7697,8 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
assert
(
maxSize
<
80
*
TSDB_MAX_COLUMNS
);
if
(
!
pSql
->
pBuf
)
{
if
(
NULL
==
(
pSql
->
pBuf
=
tcalloc
(
1
,
80
*
TSDB_MAX_COLUMNS
)))
{
if
(
!
pSql
->
cmd
.
pBuf
)
{
if
(
NULL
==
(
pSql
->
cmd
.
pBuf
=
tcalloc
(
1
,
80
*
TSDB_MAX_COLUMNS
)))
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
...
...
@@ -7718,7 +7718,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if
(
pTableMeta
->
id
.
uid
>
0
)
{
if
(
pTableMeta
->
tableType
==
TSDB_CHILD_TABLE
)
{
code
=
tscCreateTableMetaFromSTableMeta
(
pTableMeta
,
name
,
pSql
->
pBuf
);
code
=
tscCreateTableMetaFromSTableMeta
(
pTableMeta
,
name
,
pSql
->
cmd
.
pBuf
);
// create the child table meta from super table failed, try load it from mnode
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
58f2621f
...
...
@@ -2596,8 +2596,8 @@ int32_t tscGetTableMetaImpl(SSqlObj* pSql, STableMetaInfo *pTableMetaInfo, bool
// TODO resize the tableMeta
assert
(
size
<
80
*
TSDB_MAX_COLUMNS
);
if
(
!
pSql
->
pBuf
)
{
if
(
NULL
==
(
pSql
->
pBuf
=
tcalloc
(
1
,
80
*
TSDB_MAX_COLUMNS
)))
{
if
(
!
pSql
->
cmd
.
pBuf
)
{
if
(
NULL
==
(
pSql
->
cmd
.
pBuf
=
tcalloc
(
1
,
80
*
TSDB_MAX_COLUMNS
)))
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
...
...
@@ -2606,7 +2606,7 @@ int32_t tscGetTableMetaImpl(SSqlObj* pSql, STableMetaInfo *pTableMetaInfo, bool
if
(
pMeta
->
id
.
uid
>
0
)
{
// in case of child table, here only get the
if
(
pMeta
->
tableType
==
TSDB_CHILD_TABLE
)
{
int32_t
code
=
tscCreateTableMetaFromSTableMeta
(
pTableMetaInfo
->
pTableMeta
,
name
,
pSql
->
pBuf
);
int32_t
code
=
tscCreateTableMetaFromSTableMeta
(
pTableMetaInfo
->
pTableMeta
,
name
,
pSql
->
cmd
.
pBuf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
getTableMetaFromMnode
(
pSql
,
pTableMetaInfo
,
autocreate
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
58f2621f
...
...
@@ -1450,7 +1450,6 @@ void tscFreeSqlObj(SSqlObj* pSql) {
pSql
->
signature
=
NULL
;
pSql
->
fp
=
NULL
;
tfree
(
pSql
->
sqlstr
);
tfree
(
pSql
->
pBuf
);
tfree
(
pSql
->
pSubs
);
pSql
->
subState
.
numOfSub
=
0
;
...
...
@@ -1461,8 +1460,9 @@ void tscFreeSqlObj(SSqlObj* pSql) {
memset
(
pCmd
->
payload
,
0
,
(
size_t
)
pCmd
->
allocSize
);
tfree
(
pCmd
->
payload
);
tfree
(
pCmd
->
pBuf
);
pCmd
->
allocSize
=
0
;
tsem_destroy
(
&
pSql
->
rspSem
);
memset
(
pSql
,
0
,
sizeof
(
*
pSql
));
free
(
pSql
);
...
...
src/common/src/ttypes.c
浏览文件 @
58f2621f
...
...
@@ -515,7 +515,7 @@ static void *nullValues[] = {
&
nullTinyIntu
,
&
nullSmallIntu
,
&
nullIntu
,
&
nullBigIntu
,
};
void
*
getNullValue
(
int32_t
type
)
{
const
void
*
getNullValue
(
int32_t
type
)
{
assert
(
type
>=
TSDB_DATA_TYPE_BOOL
&&
type
<=
TSDB_DATA_TYPE_UBIGINT
);
return
nullValues
[
type
-
1
];
}
...
...
src/cq/src/cqMain.c
浏览文件 @
58f2621f
...
...
@@ -492,7 +492,7 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
STColumn
*
c
=
pSchema
->
columns
+
i
;
void
*
val
=
row
[
i
];
if
(
val
==
NULL
)
{
val
=
getNullValue
(
c
->
type
);
val
=
(
void
*
)
getNullValue
(
c
->
type
);
}
else
if
(
c
->
type
==
TSDB_DATA_TYPE_BINARY
)
{
val
=
((
char
*
)
val
)
-
sizeof
(
VarDataLenT
);
}
else
if
(
c
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
...
...
src/inc/taosdef.h
浏览文件 @
58f2621f
...
...
@@ -329,8 +329,9 @@ do { \
#define TSDB_MAX_JOIN_TABLE_NUM 10
#define TSDB_MAX_UNION_CLAUSE 5
#define TSDB_MAX_BINARY_LEN (16384-TSDB_KEYSIZE) // keep 16384
#define TSDB_MAX_NCHAR_LEN (16384-TSDB_KEYSIZE) // keep 16384
#define TSDB_MAX_FIELD_LEN 16384
#define TSDB_MAX_BINARY_LEN (TSDB_MAX_FIELD_LEN-TSDB_KEYSIZE) // keep 16384
#define TSDB_MAX_NCHAR_LEN (TSDB_MAX_FIELD_LEN-TSDB_KEYSIZE) // keep 16384
#define PRIMARYKEY_TIMESTAMP_COL_INDEX 0
#define TSDB_MAX_RPC_THREADS 5
...
...
src/inc/ttype.h
浏览文件 @
58f2621f
...
...
@@ -178,7 +178,7 @@ bool isValidDataType(int32_t type);
void
setVardataNull
(
char
*
val
,
int32_t
type
);
void
setNull
(
char
*
val
,
int32_t
type
,
int32_t
bytes
);
void
setNullN
(
char
*
val
,
int32_t
type
,
int32_t
bytes
,
int32_t
numOfElems
);
void
*
getNullValue
(
int32_t
type
);
const
void
*
getNullValue
(
int32_t
type
);
void
assignVal
(
char
*
val
,
const
char
*
src
,
int32_t
len
,
int32_t
type
);
void
tsDataSwap
(
void
*
pLeft
,
void
*
pRight
,
int32_t
type
,
int32_t
size
,
void
*
buf
);
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
58f2621f
...
...
@@ -787,7 +787,7 @@ static char *getTagIndexKey(const void *pData) {
void
*
res
=
tdGetKVRowValOfCol
(
pTable
->
tagVal
,
pCol
->
colId
);
if
(
res
==
NULL
)
{
// treat the column as NULL if we cannot find it
res
=
getNullValue
(
pCol
->
type
);
res
=
(
void
*
)
getNullValue
(
pCol
->
type
);
}
return
res
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录