Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
948c3b25
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
948c3b25
编写于
5月 10, 2021
作者:
H
haojun Liao
提交者:
GitHub
5月 10, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6055 from taosdata/hotfix/TD-4096
[TD-4096]<feature> support 'show create stable xx'
上级
54d3ae26
94040c49
变更
8
展开全部
显示空白变更内容
内联
并排
Showing
8 changed file
with
1007 addition
and
986 deletion
+1007
-986
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+5
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-0
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-0
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-0
src/common/inc/tcmdtype.h
src/common/inc/tcmdtype.h
+1
-0
src/inc/ttokendef.h
src/inc/ttokendef.h
+6
-6
src/query/inc/sql.y
src/query/inc/sql.y
+4
-0
src/query/src/sql.c
src/query/src/sql.c
+988
-979
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
948c3b25
...
@@ -326,6 +326,7 @@ TAOS_ROW tscFetchRow(void *param) {
...
@@ -326,6 +326,7 @@ TAOS_ROW tscFetchRow(void *param) {
pCmd
->
command
==
TSDB_SQL_FETCH
||
pCmd
->
command
==
TSDB_SQL_FETCH
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_TABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_TABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_STABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_DATABASE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_DATABASE
||
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_DESCRIBE_TABLE
||
pCmd
->
command
==
TSDB_SQL_DESCRIBE_TABLE
||
...
@@ -679,6 +680,9 @@ static int32_t tscProcessShowCreateTable(SSqlObj *pSql) {
...
@@ -679,6 +680,9 @@ static int32_t tscProcessShowCreateTable(SSqlObj *pSql) {
assert
(
pTableMetaInfo
->
pTableMeta
!=
NULL
);
assert
(
pTableMetaInfo
->
pTableMeta
!=
NULL
);
const
char
*
tableName
=
tNameGetTableName
(
&
pTableMetaInfo
->
name
);
const
char
*
tableName
=
tNameGetTableName
(
&
pTableMetaInfo
->
name
);
if
(
pSql
->
cmd
.
command
==
TSDB_SQL_SHOW_CREATE_STABLE
&&
!
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
char
*
result
=
(
char
*
)
calloc
(
1
,
TSDB_MAX_BINARY_LEN
);
char
*
result
=
(
char
*
)
calloc
(
1
,
TSDB_MAX_BINARY_LEN
);
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
@@ -907,7 +911,7 @@ int tscProcessLocalCmd(SSqlObj *pSql) {
...
@@ -907,7 +911,7 @@ int tscProcessLocalCmd(SSqlObj *pSql) {
*/
*/
pRes
->
qId
=
0x1
;
pRes
->
qId
=
0x1
;
pRes
->
numOfRows
=
0
;
pRes
->
numOfRows
=
0
;
}
else
if
(
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_TABLE
)
{
}
else
if
(
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_TABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_STABLE
)
{
pRes
->
code
=
tscProcessShowCreateTable
(
pSql
);
pRes
->
code
=
tscProcessShowCreateTable
(
pSql
);
}
else
if
(
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_DATABASE
)
{
}
else
if
(
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_DATABASE
)
{
pRes
->
code
=
tscProcessShowCreateDatabase
(
pSql
);
pRes
->
code
=
tscProcessShowCreateDatabase
(
pSql
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
948c3b25
...
@@ -441,6 +441,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -441,6 +441,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
return
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
}
}
case
TSDB_SQL_SHOW_CREATE_STABLE
:
case
TSDB_SQL_SHOW_CREATE_TABLE
:
{
case
TSDB_SQL_SHOW_CREATE_TABLE
:
{
const
char
*
msg1
=
"invalid table name"
;
const
char
*
msg1
=
"invalid table name"
;
...
...
src/client/src/tscServer.c
浏览文件 @
948c3b25
...
@@ -2641,6 +2641,7 @@ void tscInitMsgsFp() {
...
@@ -2641,6 +2641,7 @@ void tscInitMsgsFp() {
tscProcessMsgRsp
[
TSDB_SQL_ALTER_DB
]
=
tscProcessAlterDbMsgRsp
;
tscProcessMsgRsp
[
TSDB_SQL_ALTER_DB
]
=
tscProcessAlterDbMsgRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_TABLE
]
=
tscProcessShowCreateRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_TABLE
]
=
tscProcessShowCreateRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_STABLE
]
=
tscProcessShowCreateRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_DATABASE
]
=
tscProcessShowCreateRsp
;
tscProcessMsgRsp
[
TSDB_SQL_SHOW_CREATE_DATABASE
]
=
tscProcessShowCreateRsp
;
tscKeepConn
[
TSDB_SQL_SHOW
]
=
1
;
tscKeepConn
[
TSDB_SQL_SHOW
]
=
1
;
...
...
src/client/src/tscSql.c
浏览文件 @
948c3b25
...
@@ -457,6 +457,7 @@ static bool needToFetchNewBlock(SSqlObj* pSql) {
...
@@ -457,6 +457,7 @@ static bool needToFetchNewBlock(SSqlObj* pSql) {
pCmd
->
command
==
TSDB_SQL_FETCH
||
pCmd
->
command
==
TSDB_SQL_FETCH
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_SHOW
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_TABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_TABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_STABLE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_DATABASE
||
pCmd
->
command
==
TSDB_SQL_SHOW_CREATE_DATABASE
||
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_SELECT
||
pCmd
->
command
==
TSDB_SQL_DESCRIBE_TABLE
||
pCmd
->
command
==
TSDB_SQL_DESCRIBE_TABLE
||
...
...
src/common/inc/tcmdtype.h
浏览文件 @
948c3b25
...
@@ -80,6 +80,7 @@ enum {
...
@@ -80,6 +80,7 @@ enum {
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_TABLE_JOIN_RETRIEVE
,
"join-retrieve"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_TABLE_JOIN_RETRIEVE
,
"join-retrieve"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_SHOW_CREATE_TABLE
,
"show-create-table"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_SHOW_CREATE_TABLE
,
"show-create-table"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_SHOW_CREATE_STABLE
,
"show-create-stable"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_SHOW_CREATE_DATABASE
,
"show-create-database"
)
TSDB_DEFINE_SQL_TYPE
(
TSDB_SQL_SHOW_CREATE_DATABASE
,
"show-create-database"
)
/*
/*
...
...
src/inc/ttokendef.h
浏览文件 @
948c3b25
...
@@ -79,12 +79,12 @@
...
@@ -79,12 +79,12 @@
#define TK_DOT 60
#define TK_DOT 60
#define TK_CREATE 61
#define TK_CREATE 61
#define TK_TABLE 62
#define TK_TABLE 62
#define TK_
DATABASE
63
#define TK_
STABLE
63
#define TK_
TABLES
64
#define TK_
DATABASE
64
#define TK_
STABLES
65
#define TK_
TABLES
65
#define TK_
VGROUP
S 66
#define TK_
STABLE
S 66
#define TK_
DROP
67
#define TK_
VGROUPS
67
#define TK_
STABLE
68
#define TK_
DROP
68
#define TK_TOPIC 69
#define TK_TOPIC 69
#define TK_DNODE 70
#define TK_DNODE 70
#define TK_USER 71
#define TK_USER 71
...
...
src/query/inc/sql.y
浏览文件 @
948c3b25
...
@@ -94,6 +94,10 @@ cmd ::= SHOW CREATE TABLE ids(X) cpxName(Y). {
...
@@ -94,6 +94,10 @@ cmd ::= SHOW CREATE TABLE ids(X) cpxName(Y). {
X.n += Y.n;
X.n += Y.n;
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &X);
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &X);
}
}
cmd ::= SHOW CREATE STABLE ids(X) cpxName(Y). {
X.n += Y.n;
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &X);
}
cmd ::= SHOW CREATE DATABASE ids(X). {
cmd ::= SHOW CREATE DATABASE ids(X). {
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &X);
setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &X);
...
...
src/query/src/sql.c
浏览文件 @
948c3b25
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录