Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0b9d4c5f
T
TDengine
项目概览
taosdata
/
TDengine
11 个月 前同步成功
通知
1179
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0b9d4c5f
编写于
1月 04, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] fix memory leaks.
上级
93287850
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
208 addition
and
181 deletion
+208
-181
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+9
-1
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+6
-0
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+171
-170
source/libs/parser/src/dCDAstProcess.c
source/libs/parser/src/dCDAstProcess.c
+21
-9
source/libs/parser/src/parser.c
source/libs/parser/src/parser.c
+1
-1
未找到文件。
source/client/src/clientEnv.c
浏览文件 @
0b9d4c5f
...
...
@@ -180,6 +180,14 @@ void* createRequest(STscObj* pObj, __taos_async_fn_t fp, void* param, int32_t ty
return
pRequest
;
}
static
void
doFreeReqResultInfo
(
SReqResultInfo
*
pResInfo
)
{
tfree
(
pResInfo
->
pRspMsg
);
tfree
(
pResInfo
->
length
);
tfree
(
pResInfo
->
row
);
tfree
(
pResInfo
->
pCol
);
tfree
(
pResInfo
->
fields
);
}
static
void
doDestroyRequest
(
void
*
p
)
{
assert
(
p
!=
NULL
);
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
p
;
...
...
@@ -190,7 +198,7 @@ static void doDestroyRequest(void* p) {
tfree
(
pRequest
->
sqlstr
);
tfree
(
pRequest
->
pInfo
);
tfree
(
pRequest
->
body
.
resInfo
.
pRspMsg
);
doFreeReqResultInfo
(
&
pRequest
->
body
.
resInfo
);
deregisterRequest
(
pRequest
);
tfree
(
pRequest
);
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
0b9d4c5f
...
...
@@ -30,6 +30,7 @@ int genericRspCallback(void* param, const SDataBuf* pMsg, int32_t code) {
SRequestObj
*
pRequest
=
param
;
setErrno
(
pRequest
,
code
);
free
(
pMsg
->
pData
);
sem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
}
...
...
@@ -37,6 +38,7 @@ int genericRspCallback(void* param, const SDataBuf* pMsg, int32_t code) {
int
processConnectRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
param
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
free
(
pMsg
->
pData
);
setErrno
(
pRequest
,
code
);
sem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
...
...
@@ -73,6 +75,7 @@ int processConnectRsp(void* param, const SDataBuf* pMsg, int32_t code) {
tscDebug
(
"0x%"
PRIx64
" clusterId:%"
PRId64
", totalConn:%"
PRId64
,
pRequest
->
requestId
,
pConnect
->
clusterId
,
pTscObj
->
pAppInfo
->
numOfConns
);
free
(
pMsg
->
pData
);
sem_post
(
&
pRequest
->
body
.
rspSem
);
return
0
;
}
...
...
@@ -238,6 +241,7 @@ int32_t processRetrieveVndRsp(void* param, const SDataBuf* pMsg, int32_t code) {
int32_t
processCreateDbRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
// todo rsp with the vnode id list
SRequestObj
*
pRequest
=
param
;
free
(
pMsg
->
pData
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
}
...
...
@@ -245,6 +249,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
SRequestObj
*
pRequest
=
param
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
free
(
pMsg
->
pData
);
setErrno
(
pRequest
,
code
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
...
...
@@ -258,6 +263,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
tNameGetDbName
(
&
name
,
db
);
setConnectionDB
(
pRequest
->
pTscObj
,
db
);
free
(
pMsg
->
pData
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
0
;
}
...
...
source/client/test/clientTests.cpp
浏览文件 @
0b9d4c5f
...
...
@@ -57,95 +57,96 @@ TEST(testCase, connect_Test) {
taos_close
(
pConn
);
}
TEST
(
testCase
,
create_user_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"create user abc pass 'abc'"
);
if
(
taos_errno
(
pRes
)
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"failed to create user, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
TEST
(
testCase
,
create_account_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"create account aabc pass 'abc'"
);
if
(
taos_errno
(
pRes
)
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"failed to create user, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
TEST
(
testCase
,
drop_account_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"drop account aabc"
);
if
(
taos_errno
(
pRes
)
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"failed to create user, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
TEST
(
testCase
,
show_user_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"show users"
);
TAOS_ROW
pRow
=
NULL
;
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
char
str
[
512
]
=
{
0
};
while
((
pRow
=
taos_fetch_row
(
pRes
))
!=
NULL
)
{
int32_t
code
=
taos_print_row
(
str
,
pRow
,
pFields
,
numOfFields
);
printf
(
"%s
\n
"
,
str
);
}
taos_close
(
pConn
);
}
TEST
(
testCase
,
drop_user_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"drop user abc"
);
if
(
taos_errno
(
pRes
)
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"failed to create user, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
TEST
(
testCase
,
show_db_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
//TEST(testCase, create_user_Test) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
// assert(pConn != NULL);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"show databases"
);
TAOS_ROW
pRow
=
NULL
;
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
char
str
[
512
]
=
{
0
};
while
((
pRow
=
taos_fetch_row
(
pRes
))
!=
NULL
)
{
int32_t
code
=
taos_print_row
(
str
,
pRow
,
pFields
,
numOfFields
);
printf
(
"%s
\n
"
,
str
);
}
taos_close
(
pConn
);
}
//
// TAOS_RES* pRes = taos_query(pConn, "create user abc pass 'abc'");
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
// }
//
// taos_free_result(pRes);
// taos_close(pConn);
//}
//
//TEST(testCase, create_account_Test) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
// assert(pConn != NULL);
//
// TAOS_RES* pRes = taos_query(pConn, "create account aabc pass 'abc'");
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
// }
//
// taos_free_result(pRes);
// taos_close(pConn);
//}
//
//TEST(testCase, drop_account_Test) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
// assert(pConn != NULL);
//
// TAOS_RES* pRes = taos_query(pConn, "drop account aabc");
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
// }
//
// taos_free_result(pRes);
// taos_close(pConn);
//}
//
//TEST(testCase, show_user_Test) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
// assert(pConn != NULL);
//
// TAOS_RES* pRes = taos_query(pConn, "show users");
// TAOS_ROW pRow = NULL;
//
// TAOS_FIELD* pFields = taos_fetch_fields(pRes);
// int32_t numOfFields = taos_num_fields(pRes);
//
// char str[512] = {0};
// while((pRow = taos_fetch_row(pRes)) != NULL) {
// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
// printf("%s\n", str);
// }
//
// taos_free_result(pRes);
// taos_close(pConn);
//}
//
//TEST(testCase, drop_user_Test) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
// assert(pConn != NULL);
//
// TAOS_RES* pRes = taos_query(pConn, "drop user abc");
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
// }
//
// taos_free_result(pRes);
// taos_close(pConn);
//}
//
//TEST(testCase, show_db_Test) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
//// assert(pConn != NULL);
//
// TAOS_RES* pRes = taos_query(pConn, "show databases");
// TAOS_ROW pRow = NULL;
//
// TAOS_FIELD* pFields = taos_fetch_fields(pRes);
// int32_t numOfFields = taos_num_fields(pRes);
//
// char str[512] = {0};
// while((pRow = taos_fetch_row(pRes)) != NULL) {
// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
// printf("%s\n", str);
// }
//
// taos_close(pConn);
//}
TEST
(
testCase
,
create_db_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
...
...
@@ -249,36 +250,36 @@ TEST(testCase, create_db_Test) {
//// taos_close(pConn);
//}
TEST
(
testCase
,
create_stable_Test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"create database abc1"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create db, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"use abc1"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in use db, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create stable st1(ts timestamp, k int) tags(a int)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create stable, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
ASSERT_TRUE
(
pFields
==
NULL
);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
ASSERT_EQ
(
numOfFields
,
0
);
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
//
TEST(testCase, create_stable_Test) {
//
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
//
assert(pConn != NULL);
//
//
TAOS_RES* pRes = taos_query(pConn, "create database abc1");
//
if (taos_errno(pRes) != 0) {
//
printf("error in create db, reason:%s\n", taos_errstr(pRes));
//
}
//
taos_free_result(pRes);
//
//
pRes = taos_query(pConn, "use abc1");
//
if (taos_errno(pRes) != 0) {
//
printf("error in use db, reason:%s\n", taos_errstr(pRes));
//
}
//
taos_free_result(pRes);
//
//
pRes = taos_query(pConn, "create stable st1(ts timestamp, k int) tags(a int)");
//
if (taos_errno(pRes) != 0) {
//
printf("error in create stable, reason:%s\n", taos_errstr(pRes));
//
}
//
//
TAOS_FIELD* pFields = taos_fetch_fields(pRes);
//
ASSERT_TRUE(pFields == NULL);
//
//
int32_t numOfFields = taos_num_fields(pRes);
//
ASSERT_EQ(numOfFields, 0);
//
//
taos_free_result(pRes);
//
taos_close(pConn);
//
}
//TEST(testCase, create_table_Test) {
// // TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
...
...
@@ -463,64 +464,64 @@ TEST(testCase, create_db_Test) {
// taos_close(pConn);
//}
TEST
(
testCase
,
create_multiple_tables
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
pConn
,
nullptr
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"use abc1"
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table t_2 using st1 tags(1)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create multiple tables, reason:%s
\n
"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
ASSERT_TRUE
(
false
);
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table t_3 using st1 tags(2)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create multiple tables, reason:%s
\n
"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
ASSERT_TRUE
(
false
);
}
TAOS_ROW
pRow
=
NULL
;
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
char
str
[
512
]
=
{
0
};
while
((
pRow
=
taos_fetch_row
(
pRes
))
!=
NULL
)
{
int32_t
code
=
taos_print_row
(
str
,
pRow
,
pFields
,
numOfFields
);
printf
(
"%s
\n
"
,
str
);
}
taos_free_result
(
pRes
);
// for(int32_t i = 0; i < 10000; ++i) {
// char sql[512] = {0};
// snprintf(sql, tListLen(sql), "create table t_x_%d using st1 tags(2)", i);
// TAOS_RES* pres = taos_query(pConn, sql);
// if (taos_errno(pres) != 0) {
// printf("failed to create table %d\n, reason:%s", i, taos_errstr(pres));
// }
// taos_free_result(pres);
//TEST(testCase, create_multiple_tables) {
// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
// ASSERT_NE(pConn, nullptr);
//
// TAOS_RES* pRes = taos_query(pConn, "use abc1");
// taos_free_result(pRes);
//
// pRes = taos_query(pConn, "create table t_2 using st1 tags(1)");
// if (taos_errno(pRes) != 0) {
// printf("failed to create multiple tables, reason:%s\n", taos_errstr(pRes));
// taos_free_result(pRes);
// ASSERT_TRUE(false);
// }
taos_close
(
pConn
);
}
//
// taos_free_result(pRes);
// pRes = taos_query(pConn, "create table t_3 using st1 tags(2)");
// if (taos_errno(pRes) != 0) {
// printf("failed to create multiple tables, reason:%s\n", taos_errstr(pRes));
// taos_free_result(pRes);
// ASSERT_TRUE(false);
// }
//
// TAOS_ROW pRow = NULL;
// TAOS_FIELD* pFields = taos_fetch_fields(pRes);
// int32_t numOfFields = taos_num_fields(pRes);
//
// char str[512] = {0};
// while((pRow = taos_fetch_row(pRes)) != NULL) {
// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
// printf("%s\n", str);
// }
//
// taos_free_result(pRes);
//
//// for(int32_t i = 0; i < 10000; ++i) {
//// char sql[512] = {0};
//// snprintf(sql, tListLen(sql), "create table t_x_%d using st1 tags(2)", i);
//// TAOS_RES* pres = taos_query(pConn, sql);
//// if (taos_errno(pres) != 0) {
//// printf("failed to create table %d\n, reason:%s", i, taos_errstr(pres));
//// }
//// taos_free_result(pres);
//// }
//
// taos_close(pConn);
//}
TEST
(
testCase
,
generated_request_id_test
)
{
SHashObj
*
phash
=
taosHashInit
(
10000
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_ENTRY_LOCK
);
for
(
int32_t
i
=
0
;
i
<
1000000
;
++
i
)
{
uint64_t
v
=
generateRequestId
();
void
*
result
=
taosHashGet
(
phash
,
&
v
,
sizeof
(
v
));
ASSERT_EQ
(
result
,
nullptr
);
taosHashPut
(
phash
,
&
v
,
sizeof
(
v
),
NULL
,
0
);
}
//
for(int32_t i = 0; i < 1000000; ++i) {
//
uint64_t v = generateRequestId();
//
void* result = taosHashGet(phash, &v, sizeof(v));
//
ASSERT_EQ(result, nullptr);
//
taosHashPut(phash, &v, sizeof(v), NULL, 0);
//
}
taosHashClea
r
(
phash
);
taosHashClea
nup
(
phash
);
}
//TEST(testCase, projection_query_tables) {
...
...
source/libs/parser/src/dCDAstProcess.c
浏览文件 @
0b9d4c5f
...
...
@@ -378,6 +378,11 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
return
code
;
}
SKVRowBuilder
kvRowBuilder
=
{
0
};
if
(
tdInitKVRowBuilder
(
&
kvRowBuilder
)
<
0
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
SArray
*
pValList
=
pCreateTableInfo
->
pTagVals
;
size_t
numOfInputTag
=
taosArrayGetSize
(
pValList
);
...
...
@@ -393,26 +398,22 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
SSchema
*
pTagSchema
=
getTableTagSchema
(
pSuperTableMeta
);
STableComInfo
tinfo
=
getTableInfo
(
pSuperTableMeta
);
SKVRowBuilder
kvRowBuilder
=
{
0
};
if
(
tdInitKVRowBuilder
(
&
kvRowBuilder
)
<
0
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
SArray
*
pNameList
=
NULL
;
size_t
n
ameSize
=
0
;
size_t
n
umOfBoundTags
=
0
;
int32_t
schemaSize
=
getNumOfTags
(
pSuperTableMeta
);
if
(
pCreateTableInfo
->
pTagNames
)
{
pNameList
=
pCreateTableInfo
->
pTagNames
;
n
ameSize
=
taosArrayGetSize
(
pNameList
);
n
umOfBoundTags
=
taosArrayGetSize
(
pNameList
);
if
(
numOfInputTag
!=
n
ameSize
||
schemaSize
<
numOfInputTag
)
{
if
(
numOfInputTag
!=
n
umOfBoundTags
||
schemaSize
<
numOfInputTag
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
tfree
(
pSuperTableMeta
);
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg2
);
}
bool
findColumnIndex
=
false
;
for
(
int32_t
i
=
0
;
i
<
n
ameSize
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
n
umOfBoundTags
;
++
i
)
{
SToken
*
sToken
=
taosArrayGet
(
pNameList
,
i
);
char
tmpTokenBuf
[
TSDB_MAX_BYTES_PER_ROW
]
=
{
0
};
// create tmp buf to avoid alter orginal sqlstr
...
...
@@ -440,6 +441,7 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_BINARY
||
pSchema
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pItem
->
pVar
.
nLen
>
pSchema
->
bytes
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
tfree
(
pSuperTableMeta
);
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg3
);
}
}
else
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
...
...
@@ -460,12 +462,14 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
int16_t
len
=
varDataTLen
(
tagVal
);
if
(
len
>
pSchema
->
bytes
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
tfree
(
pSuperTableMeta
);
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg3
);
}
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
tfree
(
pSuperTableMeta
);
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg4
);
}
...
...
@@ -484,11 +488,14 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
}
else
{
if
(
schemaSize
!=
numOfInputTag
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
tfree
(
pSuperTableMeta
);
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg2
);
}
code
=
doParseSerializeTagValue
(
pTagSchema
,
numOfInputTag
,
&
kvRowBuilder
,
pValList
,
tinfo
.
precision
,
pMsgBuf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
tfree
(
pSuperTableMeta
);
return
code
;
}
}
...
...
@@ -496,6 +503,7 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
SKVRow
row
=
tdGetKVRowFromBuilder
(
&
kvRowBuilder
);
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
if
(
row
==
NULL
)
{
tfree
(
pSuperTableMeta
);
return
TSDB_CODE_QRY_OUT_OF_MEMORY
;
}
...
...
@@ -504,6 +512,7 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
SName
tableName
=
{
0
};
code
=
createSName
(
&
tableName
,
&
pCreateTableInfo
->
name
,
pCtx
,
pMsgBuf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pSuperTableMeta
);
return
code
;
}
...
...
@@ -529,6 +538,8 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
assert
(
info
.
vgId
==
pTableBatch
->
info
.
vgId
);
taosArrayPush
(
pTableBatch
->
req
.
pArray
,
&
req
);
}
tfree
(
pSuperTableMeta
);
}
// TODO: serialize and
...
...
@@ -567,6 +578,7 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
*
pOutput
=
(
char
*
)
pStmtInfo
;
*
len
=
sizeof
(
SVnodeModifOpStmtInfo
);
taosHashCleanup
(
pVgroupHashmap
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/parser/src/parser.c
浏览文件 @
0b9d4c5f
...
...
@@ -241,5 +241,5 @@ void qParserCleanupMetaRequestInfo(SCatalogReq* pMetaReq) {
}
void
qDestroyQuery
(
SQueryNode
*
pQuery
)
{
// todo
tfree
(
pQuery
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录