Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_50753323
TDengine
提交
136f3404
T
TDengine
项目概览
qq_50753323
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
136f3404
编写于
7月 18, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the issure #103, alter table change tag bug
上级
04e06009
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
18 addition
and
11 deletion
+18
-11
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+16
-8
src/system/src/mgmtMeter.c
src/system/src/mgmtMeter.c
+1
-1
未找到文件。
src/client/src/tscAsync.c
浏览文件 @
136f3404
...
...
@@ -526,8 +526,7 @@ void tscMeterMetaCallBack(void *param, TAOS_RES *res, int code) {
/*
* NOTE:
* transfer the sql function for metric query before get meter/metric meta,
* since in callback functions,
* only tscProcessSql(pStream->pSql) is executed!
* since in callback functions, only tscProcessSql(pStream->pSql) is executed!
*/
tscTansformSQLFunctionForMetricQuery
(
&
pSql
->
cmd
);
tscIncStreamExecutionCount
(
pSql
->
pStream
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
136f3404
...
...
@@ -1586,7 +1586,7 @@ static int32_t setExprInfoForFunctions(SSqlCmd* pCmd, SSchema* pSchema, int32_t
int16_t
type
=
0
;
int16_t
bytes
=
0
;
char
columnName
[
TSDB_COL_NAME_LEN
+
1
]
=
{
0
};
char
columnName
[
TSDB_COL_NAME_LEN
]
=
{
0
};
char
msg1
[]
=
"not support column types"
;
if
(
functionID
==
TSDB_FUNC_SPREAD
)
{
...
...
@@ -3570,20 +3570,27 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
pCmd
->
numOfCols
=
1
;
// only one column
}
else
if
(
pInfo
->
sqlType
==
ALTER_TABLE_TAGS_CHG
)
{
char
msg1
[]
=
"tag name too long"
;
char
msg2
[]
=
"invalid tag name"
;
pCmd
->
count
=
TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN
;
tVariantList
*
pVarList
=
pAlterSQL
->
varList
;
if
(
pVarList
->
nExpr
>
2
)
{
return
TSDB_CODE_INVALID_SQL
;
}
if
(
pVarList
->
a
[
0
].
pVar
.
nLen
>
TSDB_COL_NAME_LEN
||
pVarList
->
a
[
1
].
pVar
.
nLen
>
TSDB_COL_NAME_LEN
)
{
char
msg
[]
=
"tag name too long"
;
setErrMsg
(
pCmd
,
msg
,
tListLen
(
msg
));
tVariantListItem
*
pSrcItem
=
&
pAlterSQL
->
varList
->
a
[
0
];
tVariantListItem
*
pDstItem
=
&
pAlterSQL
->
varList
->
a
[
1
];
if
(
pSrcItem
->
pVar
.
nLen
>=
TSDB_COL_NAME_LEN
||
pDstItem
->
pVar
.
nLen
>=
TSDB_COL_NAME_LEN
)
{
setErrMsg
(
pCmd
,
msg1
,
tListLen
(
msg1
));
return
TSDB_CODE_INVALID_SQL
;
}
tVariantListItem
*
pSrcItem
=
&
pAlterSQL
->
varList
->
a
[
0
];
tVariantListItem
*
pDstItem
=
&
pAlterSQL
->
varList
->
a
[
1
];
if
(
pSrcItem
->
pVar
.
nType
!=
TSDB_DATA_TYPE_BINARY
||
pDstItem
->
pVar
.
nType
!=
TSDB_DATA_TYPE_BINARY
)
{
setErrMsg
(
pCmd
,
msg2
,
tListLen
(
msg2
));
return
TSDB_CODE_INVALID_SQL
;
}
bool
srcFound
=
false
;
bool
dstFound
=
false
;
...
...
@@ -3592,11 +3599,12 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char
*
tagName
=
pSchema
[
tagIdx
].
name
;
size_t
nameLen
=
strlen
(
tagName
);
if
((
!
srcFound
)
&&
strncasecmp
(
tagName
,
pSrcItem
->
pVar
.
pz
,
nameLen
)
==
0
)
{
if
((
!
srcFound
)
&&
(
strncasecmp
(
tagName
,
pSrcItem
->
pVar
.
pz
,
nameLen
)
==
0
&&
(
pSrcItem
->
pVar
.
nLen
==
nameLen
))
)
{
srcFound
=
true
;
}
if
((
!
dstFound
)
&&
strncasecmp
(
tagName
,
pDstItem
->
pVar
.
pz
,
nameLen
)
==
0
)
{
//todo extract method
if
((
!
dstFound
)
&&
(
strncasecmp
(
tagName
,
pDstItem
->
pVar
.
pz
,
nameLen
)
==
0
&&
(
pDstItem
->
pVar
.
nLen
==
nameLen
)))
{
dstFound
=
true
;
}
}
...
...
src/system/src/mgmtMeter.c
浏览文件 @
136f3404
...
...
@@ -1621,7 +1621,7 @@ int32_t mgmtMeterModifyTagNameByCol(STabObj *pMetric, uint32_t col, const char *
return
TSDB_CODE_APP_ERROR
;
}
m
Error
(
"Succeed to modify table %s tag column"
,
pMetric
->
meterId
);
m
Trace
(
"Succeed to modify table %s tag column"
,
pMetric
->
meterId
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录