Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
50f432c6
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看板
提交
50f432c6
编写于
5月 09, 2020
作者:
weixin_48148422
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix typo
上级
89147604
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
40 addition
and
49 deletion
+40
-49
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+3
-3
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-1
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+2
-2
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+2
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+18
-18
src/client/src/tscServer.c
src/client/src/tscServer.c
+5
-5
src/client/src/tscStream.c
src/client/src/tscStream.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+2
-2
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+6
-6
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+0
-9
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
50f432c6
...
@@ -31,13 +31,13 @@ extern "C" {
...
@@ -31,13 +31,13 @@ extern "C" {
#include "tscSecondaryMerge.h"
#include "tscSecondaryMerge.h"
#include "tsclient.h"
#include "tsclient.h"
#define UTIL_TABLE_IS_SUPERTABLE(metaInfo) \
#define UTIL_TABLE_IS_SUPER
_
TABLE(metaInfo) \
(((metaInfo)->pTableMeta != NULL) && ((metaInfo)->pTableMeta->tableType == TSDB_SUPER_TABLE))
(((metaInfo)->pTableMeta != NULL) && ((metaInfo)->pTableMeta->tableType == TSDB_SUPER_TABLE))
#define UTIL_TABLE_IS_CHILD_TABLE(metaInfo) \
#define UTIL_TABLE_IS_CHILD_TABLE(metaInfo) \
(((metaInfo)->pTableMeta != NULL) && ((metaInfo)->pTableMeta->tableType == TSDB_CHILD_TABLE))
(((metaInfo)->pTableMeta != NULL) && ((metaInfo)->pTableMeta->tableType == TSDB_CHILD_TABLE))
#define UTIL_TABLE_IS_NO
MR
AL_TABLE(metaInfo)\
#define UTIL_TABLE_IS_NO
RM
AL_TABLE(metaInfo)\
(!(UTIL_TABLE_IS_SUPERTABLE(metaInfo) || UTIL_TABLE_IS_CHILD_TABLE(metaInfo)))
(!(UTIL_TABLE_IS_SUPER
_
TABLE(metaInfo) || UTIL_TABLE_IS_CHILD_TABLE(metaInfo)))
#define TSDB_COL_IS_TAG(f) (((f)&TSDB_COL_TAG) != 0)
#define TSDB_COL_IS_TAG(f) (((f)&TSDB_COL_TAG) != 0)
...
...
src/client/src/tscAsync.c
浏览文件 @
50f432c6
...
@@ -471,7 +471,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -471,7 +471,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
return
;
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
return
;
if
(
code
==
TSDB_CODE_SUCCESS
&&
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
code
==
TSDB_CODE_SUCCESS
&&
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
code
=
tscGetSTableVgroupInfo
(
pSql
,
pCmd
->
clauseIndex
);
code
=
tscGetSTableVgroupInfo
(
pSql
,
pCmd
->
clauseIndex
);
pRes
->
code
=
code
;
pRes
->
code
=
code
;
...
...
src/client/src/tscLocal.c
浏览文件 @
50f432c6
...
@@ -122,7 +122,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
...
@@ -122,7 +122,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
int32_t
numOfRows
=
tscGetNumOfColumns
(
pMeta
);
int32_t
numOfRows
=
tscGetNumOfColumns
(
pMeta
);
int32_t
totalNumOfRows
=
numOfRows
+
tscGetNumOfTags
(
pMeta
);
int32_t
totalNumOfRows
=
numOfRows
+
tscGetNumOfTags
(
pMeta
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
numOfRows
=
numOfRows
+
tscGetNumOfTags
(
pMeta
);
numOfRows
=
numOfRows
+
tscGetNumOfTags
(
pMeta
);
}
}
...
@@ -161,7 +161,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
...
@@ -161,7 +161,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
}
}
}
}
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
return
0
;
return
0
;
}
}
...
...
src/client/src/tscParseInsert.c
浏览文件 @
50f432c6
...
@@ -796,7 +796,7 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql) {
...
@@ -796,7 +796,7 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql) {
return
code
;
return
code
;
}
}
if
(
!
UTIL_TABLE_IS_SUPERTABLE
(
pSTableMeterMetaInfo
))
{
if
(
!
UTIL_TABLE_IS_SUPER
_
TABLE
(
pSTableMeterMetaInfo
))
{
return
tscInvalidSQLErrMsg
(
pCmd
->
payload
,
"create table only from super table is allowed"
,
sToken
.
z
);
return
tscInvalidSQLErrMsg
(
pCmd
->
payload
,
"create table only from super table is allowed"
,
sToken
.
z
);
}
}
...
@@ -1097,7 +1097,7 @@ int doParseInsertSql(SSqlObj *pSql, char *str) {
...
@@ -1097,7 +1097,7 @@ int doParseInsertSql(SSqlObj *pSql, char *str) {
goto
_error_clean
;
// TODO: should _clean or _error_clean to async flow ????
goto
_error_clean
;
// TODO: should _clean or _error_clean to async flow ????
}
}
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
code
=
tscInvalidSQLErrMsg
(
pCmd
->
payload
,
"insert data into super table is not supported"
,
NULL
);
code
=
tscInvalidSQLErrMsg
(
pCmd
->
payload
,
"insert data into super table is not supported"
,
NULL
);
goto
_error_clean
;
goto
_error_clean
;
}
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
50f432c6
...
@@ -1352,7 +1352,7 @@ static int32_t doAddProjectionExprAndResultFields(SQueryInfo* pQueryInfo, SColum
...
@@ -1352,7 +1352,7 @@ static int32_t doAddProjectionExprAndResultFields(SQueryInfo* pQueryInfo, SColum
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMeta
);
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMeta
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
numOfTotalColumns
=
tinfo
.
numOfColumns
+
tinfo
.
numOfTags
;
numOfTotalColumns
=
tinfo
.
numOfColumns
+
tinfo
.
numOfTags
;
}
else
{
}
else
{
numOfTotalColumns
=
tinfo
.
numOfColumns
;
numOfTotalColumns
=
tinfo
.
numOfColumns
;
...
@@ -1412,7 +1412,7 @@ int32_t addProjectionExprAndResultField(SQueryInfo* pQueryInfo, tSQLExprItem* pI
...
@@ -1412,7 +1412,7 @@ int32_t addProjectionExprAndResultField(SQueryInfo* pQueryInfo, tSQLExprItem* pI
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
.
tableIndex
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
index
.
tableIndex
);
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
index
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMeta
)
&&
UTIL_TABLE_IS_NO
MR
AL_TABLE
(
pTableMetaInfo
))
{
if
(
index
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMeta
)
&&
UTIL_TABLE_IS_NO
RM
AL_TABLE
(
pTableMetaInfo
))
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
}
}
...
@@ -1866,7 +1866,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
...
@@ -1866,7 +1866,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
case
TK_TBID
:
{
case
TK_TBID
:
{
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
if
(
UTIL_TABLE_IS_NO
MR
AL_TABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_NO
RM
AL_TABLE
(
pTableMetaInfo
))
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg7
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg7
);
}
}
...
@@ -2283,7 +2283,7 @@ bool validateIpAddress(const char* ip, size_t size) {
...
@@ -2283,7 +2283,7 @@ bool validateIpAddress(const char* ip, size_t size) {
int32_t
tscTansformSQLFuncForSTableQuery
(
SQueryInfo
*
pQueryInfo
)
{
int32_t
tscTansformSQLFuncForSTableQuery
(
SQueryInfo
*
pQueryInfo
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
if
(
pTableMetaInfo
->
pTableMeta
==
NULL
||
!
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
pTableMetaInfo
->
pTableMeta
==
NULL
||
!
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
return
TSDB_CODE_INVALID_SQL
;
return
TSDB_CODE_INVALID_SQL
;
}
}
...
@@ -2322,7 +2322,7 @@ int32_t tscTansformSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
...
@@ -2322,7 +2322,7 @@ int32_t tscTansformSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
/* transfer the field-info back to original input format */
/* transfer the field-info back to original input format */
void
tscRestoreSQLFuncForSTableQuery
(
SQueryInfo
*
pQueryInfo
)
{
void
tscRestoreSQLFuncForSTableQuery
(
SQueryInfo
*
pQueryInfo
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
if
(
!
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
!
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
return
;
return
;
}
}
...
@@ -2546,7 +2546,7 @@ int32_t parseGroupbyClause(SQueryInfo* pQueryInfo, tVariantList* pList, SSqlCmd*
...
@@ -2546,7 +2546,7 @@ int32_t parseGroupbyClause(SQueryInfo* pQueryInfo, tVariantList* pList, SSqlCmd*
}
}
if
(
groupTag
)
{
if
(
groupTag
)
{
if
(
!
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
!
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg9
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg9
);
}
}
...
@@ -3258,7 +3258,7 @@ static bool validateJoinExprNode(SQueryInfo* pQueryInfo, tSQLExpr* pExpr, SColum
...
@@ -3258,7 +3258,7 @@ static bool validateJoinExprNode(SQueryInfo* pQueryInfo, tSQLExpr* pExpr, SColum
}
}
// table to table/ super table to super table are allowed
// table to table/ super table to super table are allowed
if
(
UTIL_TABLE_IS_SUPER
TABLE
(
pLeftMeterMeta
)
!=
UTIL_TABLE_IS_SUPER
TABLE
(
pRightMeterMeta
))
{
if
(
UTIL_TABLE_IS_SUPER
_TABLE
(
pLeftMeterMeta
)
!=
UTIL_TABLE_IS_SUPER_
TABLE
(
pRightMeterMeta
))
{
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg5
);
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg5
);
return
false
;
return
false
;
}
}
...
@@ -3341,7 +3341,7 @@ static int32_t handleExprInQueryCond(SQueryInfo* pQueryInfo, tSQLExpr** pExpr, S
...
@@ -3341,7 +3341,7 @@ static int32_t handleExprInQueryCond(SQueryInfo* pQueryInfo, tSQLExpr** pExpr, S
}
else
if
(
index
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMeta
)
||
}
else
if
(
index
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMeta
)
||
index
.
columnIndex
==
TSDB_TBNAME_COLUMN_INDEX
)
{
// query on tags
index
.
columnIndex
==
TSDB_TBNAME_COLUMN_INDEX
)
{
// query on tags
// check for tag query condition
// check for tag query condition
if
(
UTIL_TABLE_IS_NO
MR
AL_TABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_NO
RM
AL_TABLE
(
pTableMetaInfo
))
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
}
}
...
@@ -3701,7 +3701,7 @@ static int32_t validateJoinExpr(SQueryInfo* pQueryInfo, SCondExpr* pCondExpr) {
...
@@ -3701,7 +3701,7 @@ static int32_t validateJoinExpr(SQueryInfo* pQueryInfo, SCondExpr* pCondExpr) {
}
}
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
// for stable join, tag columns
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
// for stable join, tag columns
// must be present for join
// must be present for join
if
(
pCondExpr
->
pJoinExpr
==
NULL
)
{
if
(
pCondExpr
->
pJoinExpr
==
NULL
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
...
@@ -3739,7 +3739,7 @@ static void cleanQueryExpr(SCondExpr* pCondExpr) {
...
@@ -3739,7 +3739,7 @@ static void cleanQueryExpr(SCondExpr* pCondExpr) {
static
void
doAddJoinTagsColumnsIntoTagList
(
SQueryInfo
*
pQueryInfo
,
SCondExpr
*
pCondExpr
)
{
static
void
doAddJoinTagsColumnsIntoTagList
(
SQueryInfo
*
pQueryInfo
,
SCondExpr
*
pCondExpr
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
if
(
QUERY_IS_JOIN_QUERY
(
pQueryInfo
->
type
)
&&
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
QUERY_IS_JOIN_QUERY
(
pQueryInfo
->
type
)
&&
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
SColumnIndex
index
=
{
0
};
SColumnIndex
index
=
{
0
};
getColumnIndexByName
(
&
pCondExpr
->
pJoinExpr
->
pLeft
->
colInfo
,
pQueryInfo
,
&
index
);
getColumnIndexByName
(
&
pCondExpr
->
pJoinExpr
->
pLeft
->
colInfo
,
pQueryInfo
,
&
index
);
...
@@ -4104,7 +4104,7 @@ static void setDefaultOrderInfo(SQueryInfo* pQueryInfo) {
...
@@ -4104,7 +4104,7 @@ static void setDefaultOrderInfo(SQueryInfo* pQueryInfo) {
}
}
/* for super table query, set default ascending order for group output */
/* for super table query, set default ascending order for group output */
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
pQueryInfo
->
groupbyExpr
.
orderType
=
TSDB_ORDER_ASC
;
pQueryInfo
->
groupbyExpr
.
orderType
=
TSDB_ORDER_ASC
;
}
}
}
}
...
@@ -4130,7 +4130,7 @@ int32_t parseOrderbyClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql, SSchema
...
@@ -4130,7 +4130,7 @@ int32_t parseOrderbyClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql, SSchema
*
*
* for super table query, the order option must be less than 3.
* for super table query, the order option must be less than 3.
*/
*/
if
(
UTIL_TABLE_IS_NO
MR
AL_TABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_NO
RM
AL_TABLE
(
pTableMetaInfo
))
{
if
(
pSortorder
->
nExpr
>
1
)
{
if
(
pSortorder
->
nExpr
>
1
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg0
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg0
);
}
}
...
@@ -4151,7 +4151,7 @@ int32_t parseOrderbyClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql, SSchema
...
@@ -4151,7 +4151,7 @@ int32_t parseOrderbyClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql, SSchema
SSQLToken
columnName
=
{
pVar
->
nLen
,
pVar
->
nType
,
pVar
->
pz
};
SSQLToken
columnName
=
{
pVar
->
nLen
,
pVar
->
nType
,
pVar
->
pz
};
SColumnIndex
index
=
{
0
};
SColumnIndex
index
=
{
0
};
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
// super table query
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
// super table query
if
(
getColumnIndexByName
(
&
columnName
,
pQueryInfo
,
&
index
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
getColumnIndexByName
(
&
columnName
,
pQueryInfo
,
&
index
)
!=
TSDB_CODE_SUCCESS
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
}
}
...
@@ -4304,10 +4304,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -4304,10 +4304,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if
(
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
||
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_DROP_TAG_COLUMN
||
if
(
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
||
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_DROP_TAG_COLUMN
||
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN
)
{
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN
)
{
if
(
UTIL_TABLE_IS_NO
MR
AL_TABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_NO
RM
AL_TABLE
(
pTableMetaInfo
))
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg3
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg3
);
}
}
}
else
if
((
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
)
&&
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
)))
{
}
else
if
((
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
)
&&
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
)))
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg4
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg4
);
}
else
if
((
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_ADD_COLUMN
||
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_DROP_COLUMN
)
&&
}
else
if
((
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_ADD_COLUMN
||
pAlterSQL
->
type
==
TSDB_ALTER_TABLE_DROP_COLUMN
)
&&
UTIL_TABLE_IS_CHILD_TABLE
(
pTableMetaInfo
))
{
UTIL_TABLE_IS_CHILD_TABLE
(
pTableMetaInfo
))
{
...
@@ -4693,7 +4693,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
...
@@ -4693,7 +4693,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
}
}
// todo refactor
// todo refactor
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
if
(
!
tscQueryTags
(
pQueryInfo
))
{
// local handle the super table tag query
if
(
!
tscQueryTags
(
pQueryInfo
))
{
// local handle the super table tag query
if
(
tscIsProjectionQueryOnSTable
(
pQueryInfo
,
0
))
{
if
(
tscIsProjectionQueryOnSTable
(
pQueryInfo
,
0
))
{
if
(
pQueryInfo
->
slimit
.
limit
>
0
||
pQueryInfo
->
slimit
.
offset
>
0
)
{
if
(
pQueryInfo
->
slimit
.
limit
>
0
||
pQueryInfo
->
slimit
.
offset
>
0
)
{
...
@@ -5629,7 +5629,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
...
@@ -5629,7 +5629,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
return
code
;
return
code
;
}
}
bool
isSTable
=
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
);
bool
isSTable
=
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
);
if
(
parseSelectClause
(
&
pSql
->
cmd
,
0
,
pQuerySql
->
pSelection
,
isSTable
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
parseSelectClause
(
&
pSql
->
cmd
,
0
,
pQuerySql
->
pSelection
,
isSTable
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_INVALID_SQL
;
return
TSDB_CODE_INVALID_SQL
;
}
}
...
@@ -5773,7 +5773,7 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) {
...
@@ -5773,7 +5773,7 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) {
assert
(
pQueryInfo
->
numOfTables
==
pQuerySql
->
from
->
nExpr
);
assert
(
pQueryInfo
->
numOfTables
==
pQuerySql
->
from
->
nExpr
);
bool
isSTable
=
false
;
bool
isSTable
=
false
;
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
isSTable
=
true
;
isSTable
=
true
;
code
=
tscGetSTableVgroupInfo
(
pSql
,
index
);
code
=
tscGetSTableVgroupInfo
(
pSql
,
index
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
50f432c6
...
@@ -500,7 +500,7 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -500,7 +500,7 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
// todo valid the vgroupId at the client side
// todo valid the vgroupId at the client side
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
int32_t
vgIndex
=
pTableMetaInfo
->
vgroupIndex
;
int32_t
vgIndex
=
pTableMetaInfo
->
vgroupIndex
;
SVgroupsInfo
*
pVgroupInfo
=
pTableMetaInfo
->
vgroupList
;
SVgroupsInfo
*
pVgroupInfo
=
pTableMetaInfo
->
vgroupList
;
...
@@ -565,7 +565,7 @@ static int32_t tscEstimateQueryMsgSize(SSqlCmd *pCmd, int32_t clauseIndex) {
...
@@ -565,7 +565,7 @@ static int32_t tscEstimateQueryMsgSize(SSqlCmd *pCmd, int32_t clauseIndex) {
//STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
//STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
// table query without tags values
// table query without tags values
//if (!UTIL_TABLE_IS_SUPERTABLE(pTableMetaInfo)) {
//if (!UTIL_TABLE_IS_SUPER
_
TABLE(pTableMetaInfo)) {
return
MIN_QUERY_MSG_PKT_SIZE
+
minMsgSize
()
+
sizeof
(
SQueryTableMsg
)
+
srcColListSize
+
exprSize
+
4096
;
return
MIN_QUERY_MSG_PKT_SIZE
+
minMsgSize
()
+
sizeof
(
SQueryTableMsg
)
+
srcColListSize
+
exprSize
+
4096
;
//}
//}
...
@@ -577,10 +577,10 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -577,10 +577,10 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
&
pSql
->
cmd
,
pSql
->
cmd
.
clauseIndex
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
&
pSql
->
cmd
,
pSql
->
cmd
.
clauseIndex
,
0
);
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
UTIL_TABLE_IS_NO
MR
AL_TABLE
(
pTableMetaInfo
)
||
pTableMetaInfo
->
pVgroupTables
==
NULL
)
{
if
(
UTIL_TABLE_IS_NO
RM
AL_TABLE
(
pTableMetaInfo
)
||
pTableMetaInfo
->
pVgroupTables
==
NULL
)
{
SCMVgroupInfo
*
pVgroupInfo
=
NULL
;
SCMVgroupInfo
*
pVgroupInfo
=
NULL
;
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
int32_t
index
=
pTableMetaInfo
->
vgroupIndex
;
int32_t
index
=
pTableMetaInfo
->
vgroupIndex
;
assert
(
index
>=
0
);
assert
(
index
>=
0
);
...
@@ -2292,7 +2292,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
...
@@ -2292,7 +2292,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
taosCacheRelease
(
tscCacheHandle
,
(
void
**
)
&
pTableMeta
,
true
);
taosCacheRelease
(
tscCacheHandle
,
(
void
**
)
&
pTableMeta
,
true
);
if
(
pTableMetaInfo
->
pTableMeta
)
{
if
(
pTableMetaInfo
->
pTableMeta
)
{
bool
isSuperTable
=
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
);
bool
isSuperTable
=
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
);
taosCacheRelease
(
tscCacheHandle
,
(
void
**
)
&
(
pTableMetaInfo
->
pTableMeta
),
true
);
taosCacheRelease
(
tscCacheHandle
,
(
void
**
)
&
(
pTableMetaInfo
->
pTableMeta
),
true
);
// taosCacheRelease(tscCacheHandle, (void **)&(pTableMetaInfo->pMetricMeta), true);
// taosCacheRelease(tscCacheHandle, (void **)&(pTableMetaInfo->pMetricMeta), true);
...
...
src/client/src/tscStream.c
浏览文件 @
50f432c6
...
@@ -79,7 +79,7 @@ static void tscProcessStreamLaunchQuery(SSchedMsg *pMsg) {
...
@@ -79,7 +79,7 @@ static void tscProcessStreamLaunchQuery(SSchedMsg *pMsg) {
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
return
;
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
return
;
if
(
code
==
0
&&
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
code
==
0
&&
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
code
=
tscGetSTableVgroupInfo
(
pSql
,
0
);
code
=
tscGetSTableVgroupInfo
(
pSql
,
0
);
pSql
->
res
.
code
=
code
;
pSql
->
res
.
code
=
code
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
50f432c6
...
@@ -330,7 +330,7 @@ int32_t tscLaunchSecondPhaseSubqueries(SSqlObj* pSql) {
...
@@ -330,7 +330,7 @@ int32_t tscLaunchSecondPhaseSubqueries(SSqlObj* pSql) {
pNewQueryInfo
->
limit
=
pSupporter
->
limit
;
pNewQueryInfo
->
limit
=
pSupporter
->
limit
;
// fetch the join tag column
// fetch the join tag column
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pNewQueryInfo
,
0
);
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pNewQueryInfo
,
0
);
assert
(
pQueryInfo
->
tagCond
.
joinInfo
.
hasJoin
);
assert
(
pQueryInfo
->
tagCond
.
joinInfo
.
hasJoin
);
...
@@ -1096,7 +1096,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
...
@@ -1096,7 +1096,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
tscInitQueryInfo
(
pNewQueryInfo
);
tscInitQueryInfo
(
pNewQueryInfo
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pNewQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pNewQueryInfo
,
0
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
// return the tableId & tag
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
// return the tableId & tag
SSchema
s
=
{
0
};
SSchema
s
=
{
0
};
SColumnIndex
index
=
{
0
};
SColumnIndex
index
=
{
0
};
...
...
src/client/src/tscUtil.c
浏览文件 @
50f432c6
...
@@ -157,7 +157,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
...
@@ -157,7 +157,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
}
}
// for select query super table, the super table vgroup list can not be null in any cases.
// for select query super table, the super table vgroup list can not be null in any cases.
if
(
pQueryInfo
->
command
==
TSDB_SQL_SELECT
&&
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
pQueryInfo
->
command
==
TSDB_SQL_SELECT
&&
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
assert
(
pTableMetaInfo
->
vgroupList
!=
NULL
);
assert
(
pTableMetaInfo
->
vgroupList
!=
NULL
);
}
}
...
@@ -172,7 +172,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
...
@@ -172,7 +172,7 @@ bool tscIsTwoStageSTableQuery(SQueryInfo* pQueryInfo, int32_t tableIndex) {
if
(((
pQueryInfo
->
type
&
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
!=
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
&&
if
(((
pQueryInfo
->
type
&
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
!=
TSDB_QUERY_TYPE_STABLE_SUBQUERY
)
&&
pQueryInfo
->
command
==
TSDB_SQL_SELECT
)
{
pQueryInfo
->
command
==
TSDB_SQL_SELECT
)
{
return
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
);
return
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
);
}
}
return
false
;
return
false
;
...
@@ -187,7 +187,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
...
@@ -187,7 +187,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
* 4. show queries, instead of a select query
* 4. show queries, instead of a select query
*/
*/
size_t
numOfExprs
=
tscSqlExprNumOfExprs
(
pQueryInfo
);
size_t
numOfExprs
=
tscSqlExprNumOfExprs
(
pQueryInfo
);
if
(
pTableMetaInfo
==
NULL
||
!
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
)
||
if
(
pTableMetaInfo
==
NULL
||
!
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
)
||
pQueryInfo
->
command
==
TSDB_SQL_RETRIEVE_EMPTY_RESULT
||
numOfExprs
==
0
)
{
pQueryInfo
->
command
==
TSDB_SQL_RETRIEVE_EMPTY_RESULT
||
numOfExprs
==
0
)
{
return
false
;
return
false
;
}
}
...
@@ -1348,7 +1348,7 @@ bool tscValidateColumnId(STableMetaInfo* pTableMetaInfo, int32_t colId) {
...
@@ -1348,7 +1348,7 @@ bool tscValidateColumnId(STableMetaInfo* pTableMetaInfo, int32_t colId) {
return
false
;
return
false
;
}
}
if
(
colId
==
-
1
&&
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
colId
==
-
1
&&
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
return
true
;
return
true
;
}
}
...
@@ -1861,7 +1861,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
...
@@ -1861,7 +1861,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
}
}
assert
(
pFinalInfo
->
pTableMeta
!=
NULL
&&
pNewQueryInfo
->
numOfTables
==
1
);
assert
(
pFinalInfo
->
pTableMeta
!=
NULL
&&
pNewQueryInfo
->
numOfTables
==
1
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
if
(
UTIL_TABLE_IS_SUPER
_
TABLE
(
pTableMetaInfo
))
{
assert
(
pFinalInfo
->
vgroupList
!=
NULL
);
assert
(
pFinalInfo
->
vgroupList
!=
NULL
);
}
}
...
@@ -1996,7 +1996,7 @@ bool hasMoreVnodesToTry(SSqlObj* pSql) {
...
@@ -1996,7 +1996,7 @@ bool hasMoreVnodesToTry(SSqlObj* pSql) {
// SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
// SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
// STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
// STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
// if (!UTIL_TABLE_IS_SUPERTABLE(pTableMetaInfo) || (pTableMetaInfo->pMetricMeta == NULL)) {
// if (!UTIL_TABLE_IS_SUPER
_
TABLE(pTableMetaInfo) || (pTableMetaInfo->pMetricMeta == NULL)) {
return
false
;
return
false
;
// }
// }
...
...
src/query/src/queryExecutor.c
浏览文件 @
50f432c6
...
@@ -4685,15 +4685,6 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
...
@@ -4685,15 +4685,6 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
pQuery
->
limit
.
offset
);
pQuery
->
limit
.
offset
);
}
}
static
void
prepareQueryInfoForReverseScan
(
SQInfo
*
pQInfo
)
{
// SQuery *pQuery = pQInfo->runtimeEnv.pQuery;
// for (int32_t i = 0; i < pQInfo->groupInfo.numOfTables; ++i) {
// STableQueryInfo *pTableQueryInfo = pQInfo->pTableQueryInfo[i].pTableQInfo;
// changeMeterQueryInfoForSuppleQuery(pQuery, pTableQueryInfo);
// }
}
static
void
doSaveContext
(
SQInfo
*
pQInfo
)
{
static
void
doSaveContext
(
SQInfo
*
pQInfo
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录