Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a2bdc746
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看板
提交
a2bdc746
编写于
4月 30, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 't37'
上级
5eac06b2
1b0e7c70
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
16 deletion
+22
-16
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+1
-1
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+5
-5
src/client/src/tscServer.c
src/client/src/tscServer.c
+10
-4
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+6
-6
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
a2bdc746
...
...
@@ -298,7 +298,7 @@ STableMeta* createSuperTableMeta(STableMetaMsg* pChild);
uint32_t
tscGetTableMetaSize
(
STableMeta
*
pTableMeta
);
CChildTableMeta
*
tscCreateChildMeta
(
STableMeta
*
pTableMeta
);
uint32_t
tscGetTableMetaMaxSize
();
int32_t
tscCreateTableMetaFromCChildMeta
(
STableMeta
*
pChild
,
const
char
*
name
);
int32_t
tscCreateTableMetaFromCChildMeta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
);
STableMeta
*
tscTableMetaDup
(
STableMeta
*
pTableMeta
);
...
...
src/client/src/tscParseInsert.c
浏览文件 @
a2bdc746
...
...
@@ -1353,15 +1353,15 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
}
// make a backup as tsParseInsertSql may modify the string
char
*
sqlstr
=
strdup
(
pSql
->
sqlstr
);
//
char* sqlstr = strdup(pSql->sqlstr);
ret
=
tsParseInsertSql
(
pSql
);
if
(
(
sqlstr
==
NULL
)
||
(
pSql
->
parseRetry
>=
1
)
||
if
(
/*(sqlstr == NULL) || */
(
pSql
->
parseRetry
>=
1
)
||
(
ret
!=
TSDB_CODE_TSC_SQL_SYNTAX_ERROR
&&
ret
!=
TSDB_CODE_TSC_INVALID_SQL
))
{
free
(
sqlstr
);
//
free(sqlstr);
}
else
{
tscResetSqlCmd
(
pCmd
,
true
);
free
(
pSql
->
sqlstr
);
pSql
->
sqlstr
=
sqlstr
;
//
free(pSql->sqlstr);
//
pSql->sqlstr = sqlstr;
pSql
->
parseRetry
++
;
if
((
ret
=
tsInsertInitialCheck
(
pSql
))
==
TSDB_CODE_SUCCESS
)
{
ret
=
tsParseInsertSql
(
pSql
);
...
...
src/client/src/tscServer.c
浏览文件 @
a2bdc746
...
...
@@ -2530,10 +2530,13 @@ static int32_t getTableMetaFromMnode(SSqlObj *pSql, STableMetaInfo *pTableMetaIn
int32_t
tscGetTableMeta
(
SSqlObj
*
pSql
,
STableMetaInfo
*
pTableMetaInfo
)
{
assert
(
tIsValidName
(
&
pTableMetaInfo
->
name
));
tfree
(
pTableMetaInfo
->
pTableMeta
);
uint32_t
size
=
tscGetTableMetaMaxSize
();
pTableMetaInfo
->
pTableMeta
=
calloc
(
1
,
size
);
if
(
pTableMetaInfo
->
pTableMeta
==
NULL
)
{
pTableMetaInfo
->
pTableMeta
=
calloc
(
1
,
size
);
}
else
{
uint32_t
s
=
tscGetTableMetaSize
(
pTableMetaInfo
->
pTableMeta
);
memset
(
pTableMetaInfo
->
pTableMeta
,
0
,
s
);
}
pTableMetaInfo
->
pTableMeta
->
tableType
=
-
1
;
pTableMetaInfo
->
pTableMeta
->
tableInfo
.
numOfColumns
=
-
1
;
...
...
@@ -2545,10 +2548,13 @@ int32_t tscGetTableMeta(SSqlObj *pSql, STableMetaInfo *pTableMetaInfo) {
taosHashGetClone
(
tscTableMetaInfo
,
name
,
len
,
NULL
,
pTableMetaInfo
->
pTableMeta
,
-
1
);
// TODO resize the tableMeta
char
buf
[
80
*
1024
]
=
{
0
};
assert
(
size
<
80
*
1024
);
STableMeta
*
pMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
pMeta
->
id
.
uid
>
0
)
{
if
(
pMeta
->
tableType
==
TSDB_CHILD_TABLE
)
{
int32_t
code
=
tscCreateTableMetaFromCChildMeta
(
pTableMetaInfo
->
pTableMeta
,
name
);
int32_t
code
=
tscCreateTableMetaFromCChildMeta
(
pTableMetaInfo
->
pTableMeta
,
name
,
buf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
getTableMetaFromMnode
(
pSql
,
pTableMetaInfo
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
a2bdc746
...
...
@@ -2942,11 +2942,11 @@ CChildTableMeta* tscCreateChildMeta(STableMeta* pTableMeta) {
return
cMeta
;
}
int32_t
tscCreateTableMetaFromCChildMeta
(
STableMeta
*
pChild
,
const
char
*
name
)
{
assert
(
pChild
!=
NULL
);
int32_t
tscCreateTableMetaFromCChildMeta
(
STableMeta
*
pChild
,
const
char
*
name
,
void
*
buf
)
{
assert
(
pChild
!=
NULL
&&
buf
!=
NULL
);
uint32_t
size
=
tscGetTableMetaMaxSize
();
STableMeta
*
p
=
calloc
(
1
,
size
);
//
uint32_t size = tscGetTableMetaMaxSize();
STableMeta
*
p
=
buf
;
//
calloc(1, size);
taosHashGetClone
(
tscTableMetaInfo
,
pChild
->
sTableName
,
strnlen
(
pChild
->
sTableName
,
TSDB_TABLE_FNAME_LEN
),
NULL
,
p
,
-
1
);
if
(
p
->
id
.
uid
>
0
)
{
// tableMeta exists, build child table meta and return
...
...
@@ -2958,12 +2958,12 @@ int32_t tscCreateTableMetaFromCChildMeta(STableMeta* pChild, const char* name) {
memcpy
(
pChild
->
schema
,
p
->
schema
,
sizeof
(
SSchema
)
*
total
);
tfree
(
p
);
//
tfree(p);
return
TSDB_CODE_SUCCESS
;
}
else
{
// super table has been removed, current tableMeta is also expired. remove it here
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
tfree
(
p
);
//
tfree(p);
return
-
1
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录