Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a4282fc2
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看板
未验证
提交
a4282fc2
编写于
12月 28, 2021
作者:
H
Haojun Liao
提交者:
GitHub
12月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9456 from taosdata/feature/3.0_liaohj
Feature/3.0 liaohj
上级
b51819dd
c4424992
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1200 addition
and
1198 deletion
+1200
-1198
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+6
-6
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+2
-1
source/libs/parser/inc/ttokendef.h
source/libs/parser/inc/ttokendef.h
+99
-98
source/libs/parser/src/astToMsg.c
source/libs/parser/src/astToMsg.c
+1
-1
source/libs/parser/src/dCDAstProcess.c
source/libs/parser/src/dCDAstProcess.c
+2
-6
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+1090
-1086
未找到文件。
source/client/test/clientTests.cpp
浏览文件 @
a4282fc2
...
...
@@ -177,14 +177,14 @@ TEST(testCase, create_dnode_Test) {
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create dnode, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
ASSERT_TRUE
(
pFields
==
NULL
);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
ASSERT_EQ
(
numOfFields
,
0
);
pRes
=
taos_query
(
pConn
,
"create dnode 1.1.1.1 port 9000"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create dnode, reason:%s
\n
"
,
taos_errstr
(
pRes
));
}
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
...
...
source/libs/parser/inc/sql.y
浏览文件 @
a4282fc2
...
...
@@ -200,7 +200,8 @@ ifnotexists(X) ::= . { X.n = 0;}
/////////////////////////////////THE CREATE STATEMENT///////////////////////////////////////
//create option for dnode/db/user/account
cmd ::= CREATE DNODE ids(X) PORT ids(Y). { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 2, &X, &Y);}
cmd ::= CREATE DNODE ids(X) PORT ids(Y). { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 2, &X, &Y);}
cmd ::= CREATE DNODE IPTOKEN(X) PORT ids(Y). { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 2, &X, &Y);}
cmd ::= CREATE ACCOUNT ids(X) PASS ids(Y) acct_optr(Z).
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &X, &Y, &Z);}
cmd ::= CREATE DATABASE ifnotexists(Z) ids(X) db_optr(Y). { setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &X, &Y, &Z);}
...
...
source/libs/parser/inc/ttokendef.h
浏览文件 @
a4282fc2
...
...
@@ -104,104 +104,104 @@
#define TK_IF 86
#define TK_EXISTS 87
#define TK_PORT 88
#define TK_
AS
89
#define TK_
OUTPUTTYPE
90
#define TK_
AGGREGATE
91
#define TK_
BUFSIZE
92
#define TK_
PPS
93
#define TK_
TSERIES
94
#define TK_
DBS
95
#define TK_
STORAGE
96
#define TK_
QTIME
97
#define TK_
CONNS
98
#define TK_
STATE
99
#define TK_
COMMA
100
#define TK_
KEEP
101
#define TK_
CACHE
102
#define TK_
REPLICA
103
#define TK_
QUORUM
104
#define TK_
DAYS
105
#define TK_
MINROWS
106
#define TK_M
AX
ROWS 107
#define TK_
BLOCKS
108
#define TK_
CTIME
109
#define TK_
WAL
110
#define TK_
FSYNC
111
#define TK_
COMP
112
#define TK_
PRECISION
113
#define TK_
UPDATE
114
#define TK_
CACHELAST
115
#define TK_
UNSIGNED
116
#define TK_
TAGS
117
#define TK_
USING
118
#define TK_
NULL
119
#define TK_N
OW
120
#define TK_
SELECT
121
#define TK_
UNION
122
#define TK_
ALL
123
#define TK_
DISTINCT
124
#define TK_
FROM
125
#define TK_
VARIABLE
126
#define TK_
INTERVAL
127
#define TK_
EVERY
128
#define TK_
SESSION
129
#define TK_S
TATE_WINDOW
130
#define TK_
FILL
131
#define TK_
SLIDING
132
#define TK_
ORDER
133
#define TK_
BY
134
#define TK_
ASC
135
#define TK_
GROUP
136
#define TK_
HAVING
137
#define TK_
LIMIT
138
#define TK_
OFFSET
139
#define TK_
SLIMI
T 140
#define TK_S
OFFSET
141
#define TK_
WHERE
142
#define TK_
RESET
143
#define TK_
QUERY
144
#define TK_
SYNCDB
145
#define TK_
ADD
146
#define TK_
COLUMN
147
#define TK_
MODIFY
148
#define TK_
TAG
149
#define TK_
CHANGE
150
#define TK_
SET
151
#define TK_
KILL
152
#define TK_
CONNECTION
153
#define TK_
STREAM
154
#define TK_
COLON
155
#define TK_
ABORT
156
#define TK_A
FTER
157
#define TK_A
TTACH
158
#define TK_
BEFORE
159
#define TK_BE
GIN
160
#define TK_
CASCADE
161
#define TK_C
LUSTER
162
#define TK_C
ONFLICT
163
#define TK_CO
PY
164
#define TK_
DEFERRED
165
#define TK_DE
LIMITERS
166
#define TK_DE
TACH
167
#define TK_
EACH
168
#define TK_E
ND
169
#define TK_E
XPLAIN
170
#define TK_
FAIL
171
#define TK_F
OR
172
#define TK_
IGNORE
173
#define TK_I
MMEDIATE
174
#define TK_I
NITIALLY
175
#define TK_IN
STEAD
176
#define TK_
KEY
177
#define TK_
OF
178
#define TK_
RAISE
179
#define TK_R
EPLACE
180
#define TK_RE
STRICT
181
#define TK_R
OW
182
#define TK_
STATEMENT
183
#define TK_
TRIGGER
184
#define TK_
VIEW
185
#define TK_
IPTOKEN
186
#define TK_
IPTOKEN
89
#define TK_
AS
90
#define TK_
OUTPUTTYPE
91
#define TK_
AGGREGATE
92
#define TK_
BUFSIZE
93
#define TK_
PPS
94
#define TK_
TSERIES
95
#define TK_
DBS
96
#define TK_
STORAGE
97
#define TK_
QTIME
98
#define TK_
CONNS
99
#define TK_
STATE
100
#define TK_
COMMA
101
#define TK_
KEEP
102
#define TK_
CACHE
103
#define TK_
REPLICA
104
#define TK_
QUORUM
105
#define TK_
DAYS
106
#define TK_M
IN
ROWS 107
#define TK_
MAXROWS
108
#define TK_
BLOCKS
109
#define TK_
CTIME
110
#define TK_
WAL
111
#define TK_
FSYNC
112
#define TK_
COMP
113
#define TK_
PRECISION
114
#define TK_
UPDATE
115
#define TK_
CACHELAST
116
#define TK_
UNSIGNED
117
#define TK_
TAGS
118
#define TK_
USING
119
#define TK_N
ULL
120
#define TK_
NOW
121
#define TK_
SELECT
122
#define TK_
UNION
123
#define TK_
ALL
124
#define TK_
DISTINCT
125
#define TK_
FROM
126
#define TK_
VARIABLE
127
#define TK_
INTERVAL
128
#define TK_
EVERY
129
#define TK_S
ESSION
130
#define TK_
STATE_WINDOW
131
#define TK_
FILL
132
#define TK_
SLIDING
133
#define TK_
ORDER
134
#define TK_
BY
135
#define TK_
ASC
136
#define TK_
GROUP
137
#define TK_
HAVING
138
#define TK_
LIMIT
139
#define TK_
OFFSE
T 140
#define TK_S
LIMIT
141
#define TK_
SOFFSET
142
#define TK_
WHERE
143
#define TK_
RESET
144
#define TK_
QUERY
145
#define TK_
SYNCDB
146
#define TK_
ADD
147
#define TK_
COLUMN
148
#define TK_
MODIFY
149
#define TK_
TAG
150
#define TK_
CHANGE
151
#define TK_
SET
152
#define TK_
KILL
153
#define TK_
CONNECTION
154
#define TK_
STREAM
155
#define TK_
COLON
156
#define TK_A
BORT
157
#define TK_A
FTER
158
#define TK_
ATTACH
159
#define TK_BE
FORE
160
#define TK_
BEGIN
161
#define TK_C
ASCADE
162
#define TK_C
LUSTER
163
#define TK_CO
NFLICT
164
#define TK_
COPY
165
#define TK_DE
FERRED
166
#define TK_DE
LIMITERS
167
#define TK_
DETACH
168
#define TK_E
ACH
169
#define TK_E
ND
170
#define TK_
EXPLAIN
171
#define TK_F
AIL
172
#define TK_
FOR
173
#define TK_I
GNORE
174
#define TK_I
MMEDIATE
175
#define TK_IN
ITIALLY
176
#define TK_
INSTEAD
177
#define TK_
KEY
178
#define TK_
OF
179
#define TK_R
AISE
180
#define TK_RE
PLACE
181
#define TK_R
ESTRICT
182
#define TK_
ROW
183
#define TK_
STATEMENT
184
#define TK_
TRIGGER
185
#define TK_
VIEW
186
#define TK_SEMI 187
#define TK_NONE 188
#define TK_PREV 189
...
...
@@ -216,6 +216,7 @@
#define TK_SPACE 300
#define TK_COMMENT 301
#define TK_ILLEGAL 302
...
...
source/libs/parser/src/astToMsg.c
浏览文件 @
a4282fc2
...
...
@@ -388,7 +388,7 @@ SCreateDnodeMsg *buildCreateDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMs
}
SToken
*
id
=
taosArrayGet
(
pInfo
->
pMiscInfo
->
a
,
0
);
if
(
id
->
type
!=
TK_ID
)
{
if
(
id
->
type
!=
TK_ID
&&
id
->
type
!=
TK_IPTOKEN
)
{
buildInvalidOperationMsg
(
pMsgBuf
,
msg2
);
return
NULL
;
}
...
...
source/libs/parser/src/dCDAstProcess.c
浏览文件 @
a4282fc2
...
...
@@ -313,12 +313,8 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx *pCtx, SMsgBuf* p
return
code
;
}
const
char
*
pSTableName
=
tNameGetTableName
(
&
name
);
const
char
*
pStableName
=
tNameGetTableName
(
&
name
);
SArray
*
pValList
=
pCreateTableInfo
->
pTagVals
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
size_t
valSize
=
taosArrayGetSize
(
pValList
);
STableMeta
*
pSuperTableMeta
=
NULL
;
...
...
@@ -326,7 +322,7 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx *pCtx, SMsgBuf* p
char
dbName
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
tNameGetFullDbName
(
&
name
,
dbName
);
catalogGetTableMeta
(
pCtx
->
pCatalog
,
pCtx
->
pTransporter
,
&
pCtx
->
mgmtEpSet
,
dbName
,
pS
T
ableName
,
&
pSuperTableMeta
);
catalogGetTableMeta
(
pCtx
->
pCatalog
,
pCtx
->
pTransporter
,
&
pCtx
->
mgmtEpSet
,
dbName
,
pS
t
ableName
,
&
pSuperTableMeta
);
// too long tag values will return invalid sql, not be truncated automatically
SSchema
*
pTagSchema
=
getTableTagSchema
(
pSuperTableMeta
);
...
...
source/libs/parser/src/sql.c
浏览文件 @
a4282fc2
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录