Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
5bdbf9b4
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看板
提交
5bdbf9b4
编写于
5月 12, 2020
作者:
H
hjLiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-288]support alias name in from clause
上级
65e1ca3c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
8 deletion
+11
-8
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+4
-3
src/client/src/tscSQLParserImpl.c
src/client/src/tscSQLParserImpl.c
+3
-3
src/inc/sql.y
src/inc/sql.y
+4
-2
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
5bdbf9b4
...
...
@@ -53,9 +53,10 @@ typedef struct SMeterMetaInfo {
* 2. keep the vnode index for multi-vnode insertion
*/
int32_t
vnodeIndex
;
char
name
[
TSDB_METER_ID_LEN
+
1
];
// table(super table) name
int16_t
numOfTags
;
// total required tags in query, including groupby tags
int16_t
tagColumnIndex
[
TSDB_MAX_TAGS
];
// clause + tag projection
char
name
[
TSDB_METER_ID_LEN
+
1
];
// table(super table) name
char
aliasName
[
TSDB_METER_ID_LEN
+
1
];
// alias name
int16_t
numOfTags
;
// total required tags in query, including groupby tags
int16_t
tagColumnIndex
[
TSDB_MAX_TAGS
];
// clause + tag projection
}
SMeterMetaInfo
;
/* the structure for sql function in select clause */
...
...
src/client/src/tscSQLParserImpl.c
浏览文件 @
5bdbf9b4
...
...
@@ -366,7 +366,7 @@ void tVariantListDestroy(tVariantList *pList) {
free
(
pList
);
}
tVariantList
*
tVariantListAppendToken
(
tVariantList
*
pList
,
SSQLToken
*
p
Alias
Token
,
uint8_t
sortOrder
)
{
tVariantList
*
tVariantListAppendToken
(
tVariantList
*
pList
,
SSQLToken
*
pToken
,
uint8_t
sortOrder
)
{
if
(
pList
==
NULL
)
{
pList
=
calloc
(
1
,
sizeof
(
tVariantList
));
}
...
...
@@ -375,9 +375,9 @@ tVariantList *tVariantListAppendToken(tVariantList *pList, SSQLToken *pAliasToke
return
pList
;
}
if
(
p
Alias
Token
)
{
if
(
pToken
)
{
tVariant
t
=
{
0
};
tVariantCreate
(
&
t
,
p
Alias
Token
);
tVariantCreate
(
&
t
,
pToken
);
tVariantListItem
*
pItem
=
&
pList
->
a
[
pList
->
nExpr
++
];
memcpy
(
pItem
,
&
t
,
sizeof
(
tVariant
));
...
...
src/inc/sql.y
浏览文件 @
5bdbf9b4
...
...
@@ -406,8 +406,10 @@ as(X) ::= . { X.n = 0; }
from(A) ::= FROM tablelist(X). {A = X;}
%type tablelist {tVariantList*}
tablelist(A) ::= ids(X) cpxName(Y). { toTSDBType(X.type); X.n += Y.n; A = tVariantListAppendToken(NULL, &X, -1);}
tablelist(A) ::= tablelist(Y) COMMA ids(X) cpxName(Z). { toTSDBType(X.type); X.n += Z.n; A = tVariantListAppendToken(Y, &X, -1); }
tablelist(A) ::= ids(X) cpxName(Y). { toTSDBType(X.type); X.n += Y.n; A = tVariantListAppendToken(NULL, &X, -1); A = tVariantListAppendToken(A, &X, -1);}
tablelist(A) ::= ids(X) cpxName(Y) ids(Z). { toTSDBType(X.type); X.n += Y.n; A = tVariantListAppendToken(NULL, &X, -1); A = tVariantListAppendToken(A, &Z, -1);}
tablelist(A) ::= tablelist(Y) COMMA ids(X) cpxName(Z). { toTSDBType(X.type); X.n += Z.n; A = tVariantListAppendToken(Y, &X, -1); A = tVariantListAppendToken(A, &X, -1); }
tablelist(A) ::= tablelist(Y) COMMA ids(X) cpxName(Z) ids(F). { toTSDBType(X.type); X.n += Z.n; A = tVariantListAppendToken(Y, &X, -1); A = tVariantListAppendToken(A, &F, -1); }
// The value of interval should be the form of "number+[a,s,m,h,d,n,y]" or "now"
%type tmvar {SSQLToken}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录