Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c47646d2
T
TDengine
项目概览
慢慢CG
/
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看板
提交
c47646d2
编写于
3月 15, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support outputtype
上级
b59f6c18
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1156 addition
and
1148 deletion
+1156
-1148
src/inc/ttokendef.h
src/inc/ttokendef.h
+133
-131
src/query/inc/qSqlparser.h
src/query/inc/qSqlparser.h
+1
-0
src/query/inc/sql.y
src/query/inc/sql.y
+1
-1
src/query/src/qParserImpl.c
src/query/src/qParserImpl.c
+2
-1
src/query/src/qTokenizer.c
src/query/src/qTokenizer.c
+2
-1
src/query/src/sql.c
src/query/src/sql.c
+1017
-1014
未找到文件。
src/inc/ttokendef.h
浏览文件 @
c47646d2
...
...
@@ -100,137 +100,139 @@
#define TK_IF 81
#define TK_EXISTS 82
#define TK_AS 83
#define TK_PPS 84
#define TK_TSERIES 85
#define TK_DBS 86
#define TK_STORAGE 87
#define TK_QTIME 88
#define TK_CONNS 89
#define TK_STATE 90
#define TK_KEEP 91
#define TK_CACHE 92
#define TK_REPLICA 93
#define TK_QUORUM 94
#define TK_DAYS 95
#define TK_MINROWS 96
#define TK_MAXROWS 97
#define TK_BLOCKS 98
#define TK_CTIME 99
#define TK_WAL 100
#define TK_FSYNC 101
#define TK_COMP 102
#define TK_PRECISION 103
#define TK_UPDATE 104
#define TK_CACHELAST 105
#define TK_PARTITIONS 106
#define TK_LP 107
#define TK_RP 108
#define TK_UNSIGNED 109
#define TK_TAGS 110
#define TK_USING 111
#define TK_COMMA 112
#define TK_NULL 113
#define TK_SELECT 114
#define TK_UNION 115
#define TK_ALL 116
#define TK_DISTINCT 117
#define TK_FROM 118
#define TK_VARIABLE 119
#define TK_INTERVAL 120
#define TK_FILL 121
#define TK_SLIDING 122
#define TK_ORDER 123
#define TK_BY 124
#define TK_ASC 125
#define TK_DESC 126
#define TK_GROUP 127
#define TK_HAVING 128
#define TK_LIMIT 129
#define TK_OFFSET 130
#define TK_SLIMIT 131
#define TK_SOFFSET 132
#define TK_WHERE 133
#define TK_NOW 134
#define TK_RESET 135
#define TK_QUERY 136
#define TK_ADD 137
#define TK_COLUMN 138
#define TK_TAG 139
#define TK_CHANGE 140
#define TK_SET 141
#define TK_KILL 142
#define TK_CONNECTION 143
#define TK_STREAM 144
#define TK_COLON 145
#define TK_ABORT 146
#define TK_AFTER 147
#define TK_ATTACH 148
#define TK_BEFORE 149
#define TK_BEGIN 150
#define TK_CASCADE 151
#define TK_CLUSTER 152
#define TK_CONFLICT 153
#define TK_COPY 154
#define TK_DEFERRED 155
#define TK_DELIMITERS 156
#define TK_DETACH 157
#define TK_EACH 158
#define TK_END 159
#define TK_EXPLAIN 160
#define TK_FAIL 161
#define TK_FOR 162
#define TK_IGNORE 163
#define TK_IMMEDIATE 164
#define TK_INITIALLY 165
#define TK_INSTEAD 166
#define TK_MATCH 167
#define TK_KEY 168
#define TK_OF 169
#define TK_RAISE 170
#define TK_REPLACE 171
#define TK_RESTRICT 172
#define TK_ROW 173
#define TK_STATEMENT 174
#define TK_TRIGGER 175
#define TK_VIEW 176
#define TK_COUNT 177
#define TK_SUM 178
#define TK_AVG 179
#define TK_MIN 180
#define TK_MAX 181
#define TK_FIRST 182
#define TK_LAST 183
#define TK_TOP 184
#define TK_BOTTOM 185
#define TK_STDDEV 186
#define TK_PERCENTILE 187
#define TK_APERCENTILE 188
#define TK_LEASTSQUARES 189
#define TK_HISTOGRAM 190
#define TK_DIFF 191
#define TK_SPREAD 192
#define TK_TWA 193
#define TK_INTERP 194
#define TK_LAST_ROW 195
#define TK_RATE 196
#define TK_IRATE 197
#define TK_SUM_RATE 198
#define TK_SUM_IRATE 199
#define TK_AVG_RATE 200
#define TK_AVG_IRATE 201
#define TK_TBID 202
#define TK_SEMI 203
#define TK_NONE 204
#define TK_PREV 205
#define TK_LINEAR 206
#define TK_IMPORT 207
#define TK_METRIC 208
#define TK_TBNAME 209
#define TK_JOIN 210
#define TK_METRICS 211
#define TK_INSERT 212
#define TK_INTO 213
#define TK_VALUES 214
#define TK_OUTPUTTYPE 84
#define TK_PPS 85
#define TK_TSERIES 86
#define TK_DBS 87
#define TK_STORAGE 88
#define TK_QTIME 89
#define TK_CONNS 90
#define TK_STATE 91
#define TK_KEEP 92
#define TK_CACHE 93
#define TK_REPLICA 94
#define TK_QUORUM 95
#define TK_DAYS 96
#define TK_MINROWS 97
#define TK_MAXROWS 98
#define TK_BLOCKS 99
#define TK_CTIME 100
#define TK_WAL 101
#define TK_FSYNC 102
#define TK_COMP 103
#define TK_PRECISION 104
#define TK_UPDATE 105
#define TK_CACHELAST 106
#define TK_PARTITIONS 107
#define TK_LP 108
#define TK_RP 109
#define TK_UNSIGNED 110
#define TK_TAGS 111
#define TK_USING 112
#define TK_COMMA 113
#define TK_NULL 114
#define TK_SELECT 115
#define TK_UNION 116
#define TK_ALL 117
#define TK_DISTINCT 118
#define TK_FROM 119
#define TK_VARIABLE 120
#define TK_INTERVAL 121
#define TK_FILL 122
#define TK_SLIDING 123
#define TK_ORDER 124
#define TK_BY 125
#define TK_ASC 126
#define TK_DESC 127
#define TK_GROUP 128
#define TK_HAVING 129
#define TK_LIMIT 130
#define TK_OFFSET 131
#define TK_SLIMIT 132
#define TK_SOFFSET 133
#define TK_WHERE 134
#define TK_NOW 135
#define TK_RESET 136
#define TK_QUERY 137
#define TK_ADD 138
#define TK_COLUMN 139
#define TK_TAG 140
#define TK_CHANGE 141
#define TK_SET 142
#define TK_KILL 143
#define TK_CONNECTION 144
#define TK_STREAM 145
#define TK_COLON 146
#define TK_ABORT 147
#define TK_AFTER 148
#define TK_ATTACH 149
#define TK_BEFORE 150
#define TK_BEGIN 151
#define TK_CASCADE 152
#define TK_CLUSTER 153
#define TK_CONFLICT 154
#define TK_COPY 155
#define TK_DEFERRED 156
#define TK_DELIMITERS 157
#define TK_DETACH 158
#define TK_EACH 159
#define TK_END 160
#define TK_EXPLAIN 161
#define TK_FAIL 162
#define TK_FOR 163
#define TK_IGNORE 164
#define TK_IMMEDIATE 165
#define TK_INITIALLY 166
#define TK_INSTEAD 167
#define TK_MATCH 168
#define TK_KEY 169
#define TK_OF 170
#define TK_RAISE 171
#define TK_REPLACE 172
#define TK_RESTRICT 173
#define TK_ROW 174
#define TK_STATEMENT 175
#define TK_TRIGGER 176
#define TK_VIEW 177
#define TK_COUNT 178
#define TK_SUM 179
#define TK_AVG 180
#define TK_MIN 181
#define TK_MAX 182
#define TK_FIRST 183
#define TK_LAST 184
#define TK_TOP 185
#define TK_BOTTOM 186
#define TK_STDDEV 187
#define TK_PERCENTILE 188
#define TK_APERCENTILE 189
#define TK_LEASTSQUARES 190
#define TK_HISTOGRAM 191
#define TK_DIFF 192
#define TK_SPREAD 193
#define TK_TWA 194
#define TK_INTERP 195
#define TK_LAST_ROW 196
#define TK_RATE 197
#define TK_IRATE 198
#define TK_SUM_RATE 199
#define TK_SUM_IRATE 200
#define TK_AVG_RATE 201
#define TK_AVG_IRATE 202
#define TK_TBID 203
#define TK_SEMI 204
#define TK_NONE 205
#define TK_PREV 206
#define TK_LINEAR 207
#define TK_IMPORT 208
#define TK_METRIC 209
#define TK_TBNAME 210
#define TK_JOIN 211
#define TK_METRICS 212
#define TK_INSERT 213
#define TK_INTO 214
#define TK_VALUES 215
...
...
src/query/inc/qSqlparser.h
浏览文件 @
c47646d2
...
...
@@ -132,6 +132,7 @@ typedef struct SCreateDbInfo {
typedef
struct
SCreateFuncInfo
{
SStrToken
name
;
SStrToken
path
;
TAOS_FIELD
output
;
}
SCreateFuncInfo
;
...
...
src/query/inc/sql.y
浏览文件 @
c47646d2
...
...
@@ -194,7 +194,7 @@ 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);}
cmd ::= CREATE TOPIC ifnotexists(Z) ids(X) topic_optr(Y). { setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &X, &Y, &Z);}
cmd ::= CREATE FUNCTION ids(X) AS ids(Y)
. { setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &X, &Y
);}
cmd ::= CREATE FUNCTION ids(X) AS ids(Y)
OUTPUTTYPE typename(Z). { setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &X, &Y, &Z
);}
cmd ::= CREATE USER ids(X) PASS ids(Y). { setCreateUserSql(pInfo, &X, &Y);}
pps(Y) ::= . { Y.n = 0; }
...
...
src/query/src/qParserImpl.c
浏览文件 @
c47646d2
...
...
@@ -866,7 +866,7 @@ void setCreateDbInfo(SSqlInfo *pInfo, int32_t type, SStrToken *pToken, SCreateDb
pInfo
->
pMiscInfo
->
dbOpt
.
ignoreExists
=
pIgExists
->
n
;
// sql.y has: ifnotexists(X) ::= IF NOT EXISTS. {X.n = 1;}
}
void
setCreateFuncInfo
(
SSqlInfo
*
pInfo
,
int32_t
type
,
SStrToken
*
pName
,
SStrToken
*
pPath
)
{
void
setCreateFuncInfo
(
SSqlInfo
*
pInfo
,
int32_t
type
,
SStrToken
*
pName
,
SStrToken
*
pPath
,
TAOS_FIELD
*
output
)
{
pInfo
->
type
=
type
;
if
(
pInfo
->
pMiscInfo
==
NULL
)
{
pInfo
->
pMiscInfo
=
calloc
(
1
,
sizeof
(
SMiscInfo
));
...
...
@@ -874,6 +874,7 @@ void setCreateFuncInfo(SSqlInfo *pInfo, int32_t type, SStrToken *pName, SStrToke
pInfo
->
pMiscInfo
->
funcOpt
.
name
=
*
pName
;
pInfo
->
pMiscInfo
->
funcOpt
.
path
=
*
pPath
;
pInfo
->
pMiscInfo
->
funcOpt
.
output
=
*
output
;
}
...
...
src/query/src/qTokenizer.c
浏览文件 @
c47646d2
...
...
@@ -245,7 +245,8 @@ static SKeyword keywordTable[] = {
{
"TOPIC"
,
TK_TOPIC
},
{
"TOPICS"
,
TK_TOPICS
},
{
"FUNCTION"
,
TK_FUNCTION
},
{
"FUNCTIONS"
,
TK_FUNCTIONS
}
{
"FUNCTIONS"
,
TK_FUNCTIONS
},
{
"OUTPUTTYPE"
,
TK_OUTPUTTYPE
}
};
static
const
char
isIdChar
[]
=
{
...
...
src/query/src/sql.c
浏览文件 @
c47646d2
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录