Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
f8bab293
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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,发现更多精彩内容 >>
提交
f8bab293
编写于
9月 09, 2020
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1039
上级
e19dc2b7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
19 deletion
+19
-19
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+17
-18
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
f8bab293
...
...
@@ -232,8 +232,9 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
else
if
(
pInfo
->
type
==
TSDB_SQL_DROP_TABLE
)
{
assert
(
pInfo
->
pDCLInfo
->
nTokens
==
1
);
if
(
tscSetTableFullName
(
pTableMetaInfo
,
pzName
,
pSql
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
code
=
tscSetTableFullName
(
pTableMetaInfo
,
pzName
,
pSql
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
else
if
(
pInfo
->
type
==
TSDB_SQL_DROP_DNODE
)
{
pzName
->
n
=
strdequote
(
pzName
->
z
);
...
...
@@ -348,8 +349,8 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
case
TSDB_SQL_DESCRIBE_TABLE
:
{
SStrToken
*
pToken
=
&
pInfo
->
pDCLInfo
->
a
[
0
];
const
char
*
msg2
=
"table name is too long"
;
const
char
*
msg1
=
"invalid table name"
;
const
char
*
msg2
=
"table name is too long"
;
if
(
tscValidateName
(
pToken
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
...
...
@@ -710,7 +711,9 @@ int32_t parseSlidingClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQu
}
int32_t
tscSetTableFullName
(
STableMetaInfo
*
pTableMetaInfo
,
SStrToken
*
pzTableName
,
SSqlObj
*
pSql
)
{
const
char
*
msg
=
"name too long"
;
const
char
*
msg1
=
"name too long"
;
const
char
*
msg2
=
"invalid db name"
;
const
char
*
msg
=
msg1
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -728,16 +731,14 @@ int32_t tscSetTableFullName(STableMetaInfo* pTableMetaInfo, SStrToken* pzTableNa
}
else
{
// get current DB name first, then set it into path
SStrToken
t
=
{
0
};
getCurrentDBName
(
pSql
,
&
t
);
if
(
t
.
n
==
0
)
{
msg
=
msg2
;
}
code
=
setObjFullName
(
pTableMetaInfo
->
name
,
NULL
,
&
t
,
pzTableName
,
NULL
);
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
free
(
oldName
);
free
(
oldName
);
return
code
;
}
...
...
@@ -1072,7 +1073,7 @@ int32_t setObjFullName(char* fullName, const char* account, SStrToken* pDB, SStr
/* db name is not specified, the tableName dose not include db name */
if
(
pDB
!=
NULL
)
{
if
(
pDB
->
n
>=
TSDB_ACCT_LEN
+
TSDB_DB_NAME_LEN
)
{
if
(
pDB
->
n
>=
TSDB_ACCT_LEN
+
TSDB_DB_NAME_LEN
||
pDB
->
n
==
0
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
...
...
@@ -4450,7 +4451,6 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
const
int32_t
DEFAULT_TABLE_INDEX
=
0
;
const
char
*
msg1
=
"invalid table name"
;
const
char
*
msg2
=
"table name too long"
;
const
char
*
msg3
=
"manipulation of tag available for super table"
;
const
char
*
msg4
=
"set tag value only available for table"
;
const
char
*
msg5
=
"only support add one tag"
;
...
...
@@ -4483,7 +4483,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
if
(
tscSetTableFullName
(
pTableMetaInfo
,
&
(
pAlterSQL
->
name
),
pSql
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
)
;
return
TSDB_CODE_TSC_INVALID_SQL
;
}
int32_t
ret
=
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
...
...
@@ -5744,7 +5744,6 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
int32_t
doCheckForCreateTable
(
SSqlObj
*
pSql
,
int32_t
subClauseIndex
,
SSqlInfo
*
pInfo
)
{
const
char
*
msg1
=
"invalid table name"
;
const
char
*
msg2
=
"table name too long"
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
subClauseIndex
);
...
...
@@ -5765,7 +5764,7 @@ int32_t doCheckForCreateTable(SSqlObj* pSql, int32_t subClauseIndex, SSqlInfo* p
}
if
(
tscSetTableFullName
(
pTableMetaInfo
,
pzTableName
,
pSql
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
)
;
return
TSDB_CODE_TSC_INVALID_SQL
;
}
if
(
!
validateTableColumnInfo
(
pFieldList
,
pCmd
)
||
...
...
@@ -5820,7 +5819,7 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
}
if
(
tscSetTableFullName
(
pStableMeterMetaInfo
,
pToken
,
pSql
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
)
;
return
TSDB_CODE_TSC_INVALID_SQL
;
}
// get meter meta from mnode
...
...
@@ -6012,7 +6011,7 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) {
assert
(
pQuerySql
!=
NULL
&&
(
pQuerySql
->
from
==
NULL
||
pQuerySql
->
from
->
nExpr
>
0
));
const
char
*
msg0
=
"invalid table name"
;
const
char
*
msg1
=
"table name too long"
;
//
const char* msg1 = "table name too long";
const
char
*
msg2
=
"point interpolation query needs timestamp"
;
const
char
*
msg5
=
"fill only available for interval query"
;
const
char
*
msg6
=
"start(end) time of query range required or time range too large"
;
...
...
@@ -6085,7 +6084,7 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) {
SStrToken
t
=
{.
type
=
TSDB_DATA_TYPE_BINARY
,
.
n
=
pTableItem
->
nLen
,
.
z
=
pTableItem
->
pz
};
if
(
tscSetTableFullName
(
pTableMetaInfo1
,
&
t
,
pSql
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
)
;
return
TSDB_CODE_TSC_INVALID_SQL
;
}
tVariant
*
pTableItem1
=
&
pQuerySql
->
from
->
a
[
i
+
1
].
pVar
;
...
...
src/client/src/tscServer.c
浏览文件 @
f8bab293
...
...
@@ -2013,7 +2013,8 @@ int tscProcessUseDbRsp(SSqlObj *pSql) {
return
0
;
}
int
tscProcessDropDbRsp
(
SSqlObj
*
UNUSED_PARAM
(
pSql
))
{
int
tscProcessDropDbRsp
(
SSqlObj
*
pSql
)
{
pSql
->
pTscObj
->
db
[
0
]
=
0
;
taosCacheEmpty
(
tscCacheHandle
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录