Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
26acb61e
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
26acb61e
编写于
11月 23, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10797]<fix>: when column length is long, report 'invalid column name' error
上级
b271a14d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
15 deletion
+10
-15
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+10
-15
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
26acb61e
...
@@ -436,7 +436,7 @@ int32_t readFromFile(char *name, uint32_t *len, void **buf) {
...
@@ -436,7 +436,7 @@ int32_t readFromFile(char *name, uint32_t *len, void **buf) {
int32_t
handleUserDefinedFunc
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
)
{
int32_t
handleUserDefinedFunc
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
)
{
const
char
*
msg1
=
"invalid
ate function name
"
;
const
char
*
msg1
=
"invalid
function name or length
"
;
const
char
*
msg2
=
"path is too long"
;
const
char
*
msg2
=
"path is too long"
;
const
char
*
msg3
=
"invalid outputtype"
;
const
char
*
msg3
=
"invalid outputtype"
;
const
char
*
msg4
=
"invalid script"
;
const
char
*
msg4
=
"invalid script"
;
...
@@ -1483,9 +1483,8 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
...
@@ -1483,9 +1483,8 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
const
char
*
msg3
=
"duplicated column names"
;
const
char
*
msg3
=
"duplicated column names"
;
const
char
*
msg4
=
"invalid data type"
;
const
char
*
msg4
=
"invalid data type"
;
const
char
*
msg5
=
"invalid binary/nchar column length"
;
const
char
*
msg5
=
"invalid binary/nchar column length"
;
const
char
*
msg6
=
"invalid column name"
;
const
char
*
msg6
=
"invalid column name
or length
"
;
const
char
*
msg7
=
"too many columns"
;
const
char
*
msg7
=
"too many columns"
;
const
char
*
msg8
=
"invalid column name length"
;
// number of fields no less than 2
// number of fields no less than 2
size_t
numOfCols
=
taosArrayGetSize
(
pFieldList
);
size_t
numOfCols
=
taosArrayGetSize
(
pFieldList
);
...
@@ -1523,13 +1522,8 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
...
@@ -1523,13 +1522,8 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
return
false
;
return
false
;
}
}
int32_t
code
=
validateColumnName
(
pField
->
name
);
if
(
validateColumnName
(
pField
->
name
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg6
);
if
(
code
==
TSDB_CODE_TSC_INVALID_COLUMN_LENGTH
)
{
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg8
);
}
else
{
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg6
);
}
return
false
;
return
false
;
}
}
...
@@ -1560,7 +1554,7 @@ static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pC
...
@@ -1560,7 +1554,7 @@ static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pC
const
char
*
msg3
=
"duplicated column names"
;
const
char
*
msg3
=
"duplicated column names"
;
//const char* msg4 = "timestamp not allowed in tags";
//const char* msg4 = "timestamp not allowed in tags";
const
char
*
msg5
=
"invalid data type in tags"
;
const
char
*
msg5
=
"invalid data type in tags"
;
const
char
*
msg6
=
"invalid tag name"
;
const
char
*
msg6
=
"invalid tag name
or length
"
;
const
char
*
msg7
=
"invalid binary/nchar tag length"
;
const
char
*
msg7
=
"invalid binary/nchar tag length"
;
// number of fields at least 1
// number of fields at least 1
...
@@ -1629,7 +1623,7 @@ static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pC
...
@@ -1629,7 +1623,7 @@ static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pC
*/
*/
int32_t
validateOneTag
(
SSqlCmd
*
pCmd
,
TAOS_FIELD
*
pTagField
)
{
int32_t
validateOneTag
(
SSqlCmd
*
pCmd
,
TAOS_FIELD
*
pTagField
)
{
const
char
*
msg3
=
"tag length too long"
;
const
char
*
msg3
=
"tag length too long"
;
const
char
*
msg4
=
"invalid tag name"
;
const
char
*
msg4
=
"invalid tag name
or length
"
;
const
char
*
msg5
=
"invalid binary/nchar tag length"
;
const
char
*
msg5
=
"invalid binary/nchar tag length"
;
const
char
*
msg6
=
"invalid data type in tags"
;
const
char
*
msg6
=
"invalid data type in tags"
;
const
char
*
msg7
=
"too many columns"
;
const
char
*
msg7
=
"too many columns"
;
...
@@ -1702,7 +1696,7 @@ int32_t validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) {
...
@@ -1702,7 +1696,7 @@ int32_t validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) {
const
char
*
msg1
=
"too many columns"
;
const
char
*
msg1
=
"too many columns"
;
const
char
*
msg3
=
"column length too long"
;
const
char
*
msg3
=
"column length too long"
;
const
char
*
msg4
=
"invalid data type"
;
const
char
*
msg4
=
"invalid data type"
;
const
char
*
msg5
=
"invalid column name"
;
const
char
*
msg5
=
"invalid column name
or length
"
;
const
char
*
msg6
=
"invalid column length"
;
const
char
*
msg6
=
"invalid column length"
;
// assert(pCmd->numOfClause == 1);
// assert(pCmd->numOfClause == 1);
...
@@ -2060,7 +2054,7 @@ int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pS
...
@@ -2060,7 +2054,7 @@ int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pS
const
char
*
msg8
=
"not support distinct in nest query"
;
const
char
*
msg8
=
"not support distinct in nest query"
;
const
char
*
msg9
=
"_block_dist not support subquery, only support stable/table"
;
const
char
*
msg9
=
"_block_dist not support subquery, only support stable/table"
;
const
char
*
msg10
=
"not support group by in block func"
;
const
char
*
msg10
=
"not support group by in block func"
;
const
char
*
msg11
=
"invalid alias name"
;
const
char
*
msg11
=
"invalid alias name
or length
"
;
// too many result columns not support order by in query
// too many result columns not support order by in query
if
(
taosArrayGetSize
(
pSelNodeList
)
>
TSDB_MAX_COLUMNS
)
{
if
(
taosArrayGetSize
(
pSelNodeList
)
>
TSDB_MAX_COLUMNS
)
{
...
@@ -6770,8 +6764,9 @@ int32_t validateLocalConfig(SMiscInfo* pOptions) {
...
@@ -6770,8 +6764,9 @@ int32_t validateLocalConfig(SMiscInfo* pOptions) {
int32_t
validateColumnName
(
char
*
name
)
{
int32_t
validateColumnName
(
char
*
name
)
{
if
(
strlen
(
name
)
==
0
)
{
if
(
strlen
(
name
)
==
0
)
{
return
TSDB_CODE_TSC_INVALID_
COLUMN_LENGTH
;
return
TSDB_CODE_TSC_INVALID_
OPERATION
;
}
}
bool
ret
=
taosIsKeyWordToken
(
name
,
(
int32_t
)
strlen
(
name
));
bool
ret
=
taosIsKeyWordToken
(
name
,
(
int32_t
)
strlen
(
name
));
if
(
ret
)
{
if
(
ret
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
TSDB_CODE_TSC_INVALID_OPERATION
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录