Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c9c38344
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看板
提交
c9c38344
编写于
7月 02, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] refactor code
上级
d6dc85eb
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
48 addition
and
57 deletion
+48
-57
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+0
-2
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+0
-25
src/common/inc/tcmdtype.h
src/common/inc/tcmdtype.h
+3
-3
src/common/inc/tname.h
src/common/inc/tname.h
+2
-0
src/common/src/sqlcmdstr.c
src/common/src/sqlcmdstr.c
+1
-1
src/common/src/tname.c
src/common/src/tname.c
+26
-1
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+4
-12
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-3
src/query/src/qparserImpl.c
src/query/src/qparserImpl.c
+3
-3
src/query/src/sql.c
src/query/src/sql.c
+5
-5
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
c9c38344
...
...
@@ -176,8 +176,6 @@ SColumn* tscColumnListInsert(SArray* pColList, SColumnIndex* colIndex);
SArray
*
tscColumnListClone
(
const
SArray
*
src
,
int16_t
tableIndex
);
void
tscColumnListDestroy
(
SArray
*
pColList
);
SColumnFilterInfo
*
tscFilterInfoClone
(
const
SColumnFilterInfo
*
src
,
int32_t
numOfFilters
);
int32_t
tscValidateName
(
SSQLToken
*
pToken
);
void
tscIncStreamExecutionCount
(
void
*
pStream
);
...
...
src/client/inc/tsclient.h
浏览文件 @
c9c38344
...
...
@@ -32,8 +32,8 @@ extern "C" {
#include "qExecutor.h"
#include "qsqlparser.h"
#include "qsqltype.h"
#include "qtsbuf.h"
#include "tcmdtype.h"
// forward declaration
struct
SSqlInfo
;
...
...
src/client/src/tscServer.c
浏览文件 @
c9c38344
...
...
@@ -14,8 +14,8 @@
*/
#include "os.h"
#include "qsqltype.h"
#include "tcache.h"
#include "tcmdtype.h"
#include "trpc.h"
#include "tscLocalMerge.h"
#include "tscLog.h"
...
...
src/client/src/tscUtil.c
浏览文件 @
c9c38344
...
...
@@ -1115,31 +1115,6 @@ SColumn* tscColumnListInsert(SArray* pColumnList, SColumnIndex* pColIndex) {
return
taosArrayGetP
(
pColumnList
,
i
);
}
SColumnFilterInfo
*
tscFilterInfoClone
(
const
SColumnFilterInfo
*
src
,
int32_t
numOfFilters
)
{
if
(
numOfFilters
==
0
)
{
assert
(
src
==
NULL
);
return
NULL
;
}
SColumnFilterInfo
*
pFilter
=
calloc
(
1
,
numOfFilters
*
sizeof
(
SColumnFilterInfo
));
memcpy
(
pFilter
,
src
,
sizeof
(
SColumnFilterInfo
)
*
numOfFilters
);
for
(
int32_t
j
=
0
;
j
<
numOfFilters
;
++
j
)
{
if
(
pFilter
[
j
].
filterstr
)
{
size_t
len
=
(
size_t
)
pFilter
[
j
].
len
+
1
*
TSDB_NCHAR_SIZE
;
pFilter
[
j
].
pz
=
(
int64_t
)
calloc
(
1
,
len
);
memcpy
((
char
*
)
pFilter
[
j
].
pz
,
(
char
*
)
src
[
j
].
pz
,
(
size_t
)
len
);
}
}
assert
(
src
->
filterstr
==
0
||
src
->
filterstr
==
1
);
assert
(
!
(
src
->
lowerRelOptr
==
TSDB_RELATION_INVALID
&&
src
->
upperRelOptr
==
TSDB_RELATION_INVALID
));
return
pFilter
;
}
static
void
destroyFilterInfo
(
SColumnFilterInfo
*
pFilterInfo
,
int32_t
numOfFilters
)
{
for
(
int32_t
i
=
0
;
i
<
numOfFilters
;
++
i
)
{
if
(
pFilterInfo
[
i
].
filterstr
)
{
...
...
src/common/inc/
qsql
type.h
→
src/common/inc/
tcmd
type.h
浏览文件 @
c9c38344
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_
QSQLCMD
_H
#define TDENGINE_
QSQLCMD
_H
#ifndef TDENGINE_
TSQLMSGTYPE
_H
#define TDENGINE_
TSQLMSGTYPE
_H
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -109,4 +109,4 @@ extern char *sqlCmd[];
}
#endif
#endif // TDENGINE_
QSQLCMD
_H
#endif // TDENGINE_
TSQLMSGTYPE
_H
src/common/inc/tname.h
浏览文件 @
c9c38344
...
...
@@ -27,4 +27,6 @@ SSchema tGetTableNameColumnSchema();
bool
tscValidateTableNameLength
(
size_t
len
);
SColumnFilterInfo
*
tscFilterInfoClone
(
const
SColumnFilterInfo
*
src
,
int32_t
numOfFilters
);
#endif // TDENGINE_NAME_H
src/common/src/sqlcmdstr.c
浏览文件 @
c9c38344
...
...
@@ -15,4 +15,4 @@
#define TSDB_SQL_C
#include "
qsql
type.h"
#include "
tcmd
type.h"
src/common/src/tname.c
浏览文件 @
c9c38344
...
...
@@ -49,4 +49,29 @@ SSchema tGetTableNameColumnSchema() {
bool
tscValidateTableNameLength
(
size_t
len
)
{
return
len
<
TSDB_TABLE_NAME_LEN
;
}
\ No newline at end of file
}
SColumnFilterInfo
*
tscFilterInfoClone
(
const
SColumnFilterInfo
*
src
,
int32_t
numOfFilters
)
{
if
(
numOfFilters
==
0
)
{
assert
(
src
==
NULL
);
return
NULL
;
}
SColumnFilterInfo
*
pFilter
=
calloc
(
1
,
numOfFilters
*
sizeof
(
SColumnFilterInfo
));
memcpy
(
pFilter
,
src
,
sizeof
(
SColumnFilterInfo
)
*
numOfFilters
);
for
(
int32_t
j
=
0
;
j
<
numOfFilters
;
++
j
)
{
if
(
pFilter
[
j
].
filterstr
)
{
size_t
len
=
(
size_t
)
pFilter
[
j
].
len
+
1
*
TSDB_NCHAR_SIZE
;
pFilter
[
j
].
pz
=
(
int64_t
)
calloc
(
1
,
len
);
memcpy
((
char
*
)
pFilter
[
j
].
pz
,
(
char
*
)
src
[
j
].
pz
,
(
size_t
)
len
);
}
}
assert
(
src
->
filterstr
==
0
||
src
->
filterstr
==
1
);
assert
(
!
(
src
->
lowerRelOptr
==
TSDB_RELATION_INVALID
&&
src
->
upperRelOptr
==
TSDB_RELATION_INVALID
));
return
pFilter
;
}
src/query/inc/qExecutor.h
浏览文件 @
c9c38344
...
...
@@ -95,16 +95,13 @@ typedef struct SSingleColumnFilterInfo {
}
SSingleColumnFilterInfo
;
typedef
struct
STableQueryInfo
{
// todo merge with the STableQueryInfo struct
int32_t
tableIndex
;
int32_t
groupIndex
;
// group id in table list
TSKEY
lastKey
;
int32_t
numOfRes
;
int32_t
groupIndex
;
// group id in table list
int16_t
queryRangeSet
;
// denote if the query range is set, only available for interval query
int64_t
tag
;
STimeWindow
win
;
STSCursor
cur
;
void
*
pTable
;
// for retrieve the page id list
void
*
pTable
;
// for retrieve the page id list
SWindowResInfo
windowResInfo
;
}
STableQueryInfo
;
...
...
@@ -127,11 +124,6 @@ typedef struct SQueryCostInfo {
uint64_t
computTime
;
}
SQueryCostInfo
;
//typedef struct SGroupItem {
// void *pTable;
// STableQueryInfo *info;
//} SGroupItem;
typedef
struct
SQuery
{
int16_t
numOfCols
;
int16_t
numOfTags
;
...
...
@@ -173,12 +165,12 @@ typedef struct SQueryRuntimeEnv {
STSBuf
*
pTSBuf
;
STSCursor
cur
;
SQueryCostInfo
summary
;
bool
stableQuery
;
// super table query or not
void
*
pQueryHandle
;
void
*
pSecQueryHandle
;
// another thread for
SDiskbasedResultBuf
*
pResultBuf
;
// query result buffer based on blocked-wised disk file
bool
stableQuery
;
// super table query or not
bool
topBotQuery
;
// false
int32_t
prevGroupId
;
// previous executed group id
SDiskbasedResultBuf
*
pResultBuf
;
// query result buffer based on blocked-wised disk file
}
SQueryRuntimeEnv
;
typedef
struct
SQInfo
{
...
...
src/query/src/qExecutor.c
浏览文件 @
c9c38344
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include "taosmsg.h"
#include "qfill.h"
#include "hash.h"
...
...
@@ -22,9 +23,8 @@
#include "qresultBuf.h"
#include "query.h"
#include "queryLog.h"
#include "taosmsg.h"
#include "tlosertree.h"
#include "
tscUtil.h" // todo move the function to common module
#include "
exception.h"
#include "tscompression.h"
#include "ttime.h"
...
...
@@ -5656,7 +5656,6 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
STableQueryInfo
*
item
=
createTableQueryInfo
(
&
pQInfo
->
runtimeEnv
,
pTable
,
window
);
item
->
groupIndex
=
i
;
item
->
tableIndex
=
tableIndex
++
;
taosArrayPush
(
p1
,
&
item
);
taosHashPut
(
pQInfo
->
tableqinfoGroupInfo
.
map
,
&
id
.
tid
,
sizeof
(
id
.
tid
),
&
item
,
POINTER_BYTES
);
}
...
...
src/query/src/qparserImpl.c
浏览文件 @
c9c38344
...
...
@@ -15,16 +15,16 @@
#include "os.h"
#include "qsqlparser.h"
#include "queryLog.h"
#include "taosdef.h"
#include "taosmsg.h"
#include "tcmdtype.h"
#include "tglobal.h"
#include "tstoken.h"
#include "tstrbuild.h"
#include "ttime.h"
#include "ttokendef.h"
#include "tutil.h"
#include "qsqltype.h"
#include "tstrbuild.h"
#include "queryLog.h"
SSqlInfo
qSQLParse
(
const
char
*
pStr
)
{
void
*
pParser
=
ParseAlloc
(
malloc
);
...
...
src/query/src/sql.c
浏览文件 @
c9c38344
...
...
@@ -25,17 +25,17 @@
#include <stdio.h>
/************ Begin %include sections from the grammar ************************/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include "tutil.h"
#include "qsqlparser.h"
#include "tcmdtype.h"
#include "tstoken.h"
#include "tvariant.h"
#include "ttokendef.h"
#include "qsqltype.h"
#include "tutil.h"
#include "tvariant.h"
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols
** in a format understandable to "makeheaders". This section is blank unless
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录