Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
501c98c9
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
501c98c9
编写于
3月 10, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2.0' into refact/slguan
上级
fcde3402
23bed109
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
165 addition
and
188 deletion
+165
-188
src/CMakeLists.txt
src/CMakeLists.txt
+7
-3
src/client/CMakeLists.txt
src/client/CMakeLists.txt
+2
-2
src/client/inc/tscSQLParser.h
src/client/inc/tscSQLParser.h
+1
-1
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+1
-1
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+1
-1
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+1
-1
src/client/src/tscSchemaUtil.c
src/client/src/tscSchemaUtil.c
+1
-1
src/common/CMakeLists.txt
src/common/CMakeLists.txt
+9
-0
src/common/inc/dataformat.h
src/common/inc/dataformat.h
+4
-3
src/common/src/dataformat.c
src/common/src/dataformat.c
+32
-32
src/common/src/ttypes.c
src/common/src/ttypes.c
+2
-3
src/inc/taos.h
src/inc/taos.h
+0
-12
src/inc/taosdef.h
src/inc/taosdef.h
+79
-11
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+1
-1
src/query/inc/tast.h
src/query/inc/tast.h
+1
-1
src/query/inc/tsqlfunction.h
src/query/inc/tsqlfunction.h
+1
-1
src/query/inc/tvariant.h
src/query/inc/tvariant.h
+2
-0
src/query/src/textbuffer.c
src/query/src/textbuffer.c
+1
-1
src/query/src/tinterpolation.c
src/query/src/tinterpolation.c
+1
-1
src/query/src/tpercentile.c
src/query/src/tpercentile.c
+1
-1
src/query/src/tscAst.c
src/query/src/tscAst.c
+1
-1
src/query/src/tscSQLParserImpl.c
src/query/src/tscSQLParserImpl.c
+1
-1
src/query/src/tscSyntaxtreefunction.c
src/query/src/tscSyntaxtreefunction.c
+1
-1
src/query/src/ttokenizer.c
src/query/src/ttokenizer.c
+1
-1
src/query/src/tvariant.c
src/query/src/tvariant.c
+2
-2
src/thirdparty/CMakeLists.txt
src/thirdparty/CMakeLists.txt
+4
-0
src/thirdparty/inc/lz4.h
src/thirdparty/inc/lz4.h
+0
-0
src/thirdparty/src/lz4.c
src/thirdparty/src/lz4.c
+0
-0
src/util/CMakeLists.txt
src/util/CMakeLists.txt
+3
-3
src/util/inc/sskiplist.h
src/util/inc/sskiplist.h
+1
-1
src/util/inc/tskiplist.h
src/util/inc/tskiplist.h
+1
-1
src/util/inc/ttypes.h
src/util/inc/ttypes.h
+0
-74
src/util/inc/tutil.h
src/util/inc/tutil.h
+0
-23
src/util/src/tcompression.c
src/util/src/tcompression.c
+0
-1
src/util/src/tutil.c
src/util/src/tutil.c
+1
-1
src/vnode/CMakeLists.txt
src/vnode/CMakeLists.txt
+1
-1
未找到文件。
src/CMakeLists.txt
浏览文件 @
501c98c9
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
PROJECT
(
TDengine
)
PROJECT
(
TDengine
)
# Base compile
ADD_SUBDIRECTORY
(
os
)
ADD_SUBDIRECTORY
(
os
)
ADD_SUBDIRECTORY
(
thirdparty
)
ADD_SUBDIRECTORY
(
common
)
ADD_SUBDIRECTORY
(
util
)
ADD_SUBDIRECTORY
(
util
)
ADD_SUBDIRECTORY
(
rpc
)
ADD_SUBDIRECTORY
(
rpc
)
ADD_SUBDIRECTORY
(
client
)
ADD_SUBDIRECTORY
(
client
)
ADD_SUBDIRECTORY
(
query
)
ADD_SUBDIRECTORY
(
kit
)
ADD_SUBDIRECTORY
(
kit
)
ADD_SUBDIRECTORY
(
plugins
)
ADD_SUBDIRECTORY
(
plugins
)
ADD_SUBDIRECTORY
(
sdb
)
ADD_SUBDIRECTORY
(
sdb
)
ADD_SUBDIRECTORY
(
mnode
)
ADD_SUBDIRECTORY
(
mnode
)
ADD_SUBDIRECTORY
(
vnode
)
# ADD_SUBDIRECTORY(vnode)
ADD_SUBDIRECTORY
(
dnode
)
# ADD_SUBDIRECTORY(dnode)
ADD_SUBDIRECTORY
(
query
)
#ADD_SUBDIRECTORY(connector/jdbc)
#ADD_SUBDIRECTORY(connector/jdbc)
src/client/CMakeLists.txt
浏览文件 @
501c98c9
...
@@ -15,13 +15,13 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
...
@@ -15,13 +15,13 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
# set the static lib name
# set the static lib name
ADD_LIBRARY
(
taos_static STATIC
${
SRC
}
)
ADD_LIBRARY
(
taos_static STATIC
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taos_static query trpc tutil pthread m rt
)
TARGET_LINK_LIBRARIES
(
taos_static
common
query trpc tutil pthread m rt
)
SET_TARGET_PROPERTIES
(
taos_static PROPERTIES OUTPUT_NAME
"taos_static"
)
SET_TARGET_PROPERTIES
(
taos_static PROPERTIES OUTPUT_NAME
"taos_static"
)
SET_TARGET_PROPERTIES
(
taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1
)
SET_TARGET_PROPERTIES
(
taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1
)
# generate dynamic library (*.so)
# generate dynamic library (*.so)
ADD_LIBRARY
(
taos SHARED
${
SRC
}
)
ADD_LIBRARY
(
taos SHARED
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taos trpc tutil pthread m rt
)
TARGET_LINK_LIBRARIES
(
taos
common
trpc tutil pthread m rt
)
SET_TARGET_PROPERTIES
(
taos PROPERTIES CLEAN_DIRECT_OUTPUT 1
)
SET_TARGET_PROPERTIES
(
taos PROPERTIES CLEAN_DIRECT_OUTPUT 1
)
#set version of .so
#set version of .so
...
...
src/client/inc/tscSQLParser.h
浏览文件 @
501c98c9
...
@@ -23,7 +23,7 @@ extern "C" {
...
@@ -23,7 +23,7 @@ extern "C" {
#include "taos.h"
#include "taos.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tvariant.h"
#include "tvariant.h"
#include "qsqlparser.h"
#include "qsqlparser.h"
...
...
src/client/src/tscFunctionImpl.c
浏览文件 @
501c98c9
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "tscompression.h"
#include "tscompression.h"
#include "tsqlfunction.h"
#include "tsqlfunction.h"
#include "ttime.h"
#include "ttime.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
#include "tpercentile.h"
#include "tpercentile.h"
...
...
src/client/src/tscLocal.c
浏览文件 @
501c98c9
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "tcache.h"
#include "tcache.h"
#include "tscUtil.h"
#include "tscUtil.h"
#include "tsclient.h"
#include "tsclient.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "textbuffer.h"
#include "textbuffer.h"
#include "tscSecondaryMerge.h"
#include "tscSecondaryMerge.h"
...
...
src/client/src/tscParseInsert.c
浏览文件 @
501c98c9
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "tschemautil.h"
#include "tschemautil.h"
#include "tsclient.h"
#include "tsclient.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tlog.h"
#include "tlog.h"
#include "tstoken.h"
#include "tstoken.h"
...
...
src/client/src/tscSchemaUtil.c
浏览文件 @
501c98c9
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include "taosmsg.h"
#include "taosmsg.h"
#include "tschemautil.h"
#include "tschemautil.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
bool
isValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
)
{
bool
isValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
)
{
...
...
src/common/CMakeLists.txt
0 → 100644
浏览文件 @
501c98c9
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SOURCE_LIST
)
add_library
(
common
${
SOURCE_LIST
}
)
target_include_directories
(
common
PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc
PUBLIC
${
CMAKE_SOURCE_DIR
}
/src/inc
PUBLIC
${
CMAKE_SOURCE_DIR
}
/src/os/linux/inc
)
\ No newline at end of file
src/
vnode/
common/inc/dataformat.h
→
src/common/inc/dataformat.h
浏览文件 @
501c98c9
...
@@ -17,8 +17,9 @@
...
@@ -17,8 +17,9 @@
#include <stdint.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include "schema.h"
//
#include "schema.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -43,9 +44,9 @@ typedef void *SDataRow;
...
@@ -43,9 +44,9 @@ typedef void *SDataRow;
#define dataRowCpy(dst, r) memcpy((dst), (r), dataRowLen(r))
#define dataRowCpy(dst, r) memcpy((dst), (r), dataRowLen(r))
SDataRow
tdNewDataRow
(
int32_t
bytes
);
SDataRow
tdNewDataRow
(
int32_t
bytes
);
SDataRow
tdNewDdataFromSchema
(
SSchema
*
pSchema
);
//
SDataRow tdNewDdataFromSchema(SSchema *pSchema);
void
tdFreeDataRow
(
SDataRow
row
);
void
tdFreeDataRow
(
SDataRow
row
);
int32_t
tdAppendColVal
(
SDataRow
row
,
void
*
value
,
SColumn
*
pCol
,
int32_t
suffixOffset
);
//
int32_t tdAppendColVal(SDataRow row, void *value, SColumn *pCol, int32_t suffixOffset);
void
tdDataRowCpy
(
void
*
dst
,
SDataRow
row
);
void
tdDataRowCpy
(
void
*
dst
,
SDataRow
row
);
void
tdDataRowReset
(
SDataRow
row
);
void
tdDataRowReset
(
SDataRow
row
);
SDataRow
tdDataRowDup
(
SDataRow
row
);
SDataRow
tdDataRowDup
(
SDataRow
row
);
...
...
src/
vnode/
common/src/dataformat.c
→
src/common/src/dataformat.c
浏览文件 @
501c98c9
...
@@ -21,10 +21,10 @@ SDataRow tdNewDataRow(int32_t bytes) {
...
@@ -21,10 +21,10 @@ SDataRow tdNewDataRow(int32_t bytes) {
return
row
;
return
row
;
}
}
SDataRow
tdNewDdataFromSchema
(
SSchema
*
pSchema
)
{
//
SDataRow tdNewDdataFromSchema(SSchema *pSchema) {
int32_t
bytes
=
tdMaxRowDataBytes
(
pSchema
);
//
int32_t bytes = tdMaxRowDataBytes(pSchema);
return
tdNewDataRow
(
bytes
);
//
return tdNewDataRow(bytes);
}
//
}
/**
/**
* Free the SDataRow object
* Free the SDataRow object
...
@@ -45,34 +45,34 @@ void tdFreeDataRow(SDataRow row) {
...
@@ -45,34 +45,34 @@ void tdFreeDataRow(SDataRow row) {
*
*
* @return 0 for success and -1 for failure
* @return 0 for success and -1 for failure
*/
*/
int32_t
tdAppendColVal
(
SDataRow
row
,
void
*
value
,
SColumn
*
pCol
,
int32_t
suffixOffset
)
{
//
int32_t tdAppendColVal(SDataRow row, void *value, SColumn *pCol, int32_t suffixOffset) {
int32_t
offset
;
//
int32_t offset;
switch
(
pCol
->
type
)
{
//
switch (pCol->type) {
case
TD_DATATYPE_BOOL
:
//
case TD_DATATYPE_BOOL:
case
TD_DATATYPE_TINYINT
:
//
case TD_DATATYPE_TINYINT:
case
TD_DATATYPE_SMALLINT
:
//
case TD_DATATYPE_SMALLINT:
case
TD_DATATYPE_INT
:
//
case TD_DATATYPE_INT:
case
TD_DATATYPE_BIGINT
:
//
case TD_DATATYPE_BIGINT:
case
TD_DATATYPE_FLOAT
:
//
case TD_DATATYPE_FLOAT:
case
TD_DATATYPE_DOUBLE
:
//
case TD_DATATYPE_DOUBLE:
case
TD_DATATYPE_TIMESTAMP
:
//
case TD_DATATYPE_TIMESTAMP:
memcpy
(
dataRowIdx
(
row
,
pCol
->
offset
+
sizeof
(
int32_t
)),
value
,
rowDataLen
[
pCol
->
type
]);
//
memcpy(dataRowIdx(row, pCol->offset + sizeof(int32_t)), value, rowDataLen[pCol->type]);
if
(
dataRowLen
(
row
)
<
suffixOffset
+
sizeof
(
int32_t
))
//
if (dataRowLen(row) < suffixOffset + sizeof(int32_t))
dataRowSetLen
(
row
,
dataRowLen
(
row
)
+
rowDataLen
[
pCol
->
type
]);
//
dataRowSetLen(row, dataRowLen(row) + rowDataLen[pCol->type]);
break
;
//
break;
case
TD_DATATYPE_VARCHAR
:
//
case TD_DATATYPE_VARCHAR:
offset
=
dataRowLen
(
row
)
>
suffixOffset
?
dataRowLen
(
row
)
:
suffixOffset
;
//
offset = dataRowLen(row) > suffixOffset ? dataRowLen(row) : suffixOffset;
memcpy
(
dataRowIdx
(
row
,
pCol
->
offset
+
sizeof
(
int32_t
)),
(
void
*
)(
&
offset
),
sizeof
(
offset
));
//
memcpy(dataRowIdx(row, pCol->offset+sizeof(int32_t)), (void *)(&offset), sizeof(offset));
case
TD_DATATYPE_NCHAR
:
//
case TD_DATATYPE_NCHAR:
case
TD_DATATYPE_BINARY
:
//
case TD_DATATYPE_BINARY:
break
;
//
break;
default:
//
default:
return
-
1
;
//
return -1;
}
//
}
return
0
;
//
return 0;
}
//
}
/**
/**
* Copy a data row to a destination
* Copy a data row to a destination
...
...
src/
util
/src/ttypes.c
→
src/
common
/src/ttypes.c
浏览文件 @
501c98c9
...
@@ -12,12 +12,11 @@
...
@@ -12,12 +12,11 @@
* You should have received a copy of the GNU Affero General Public License
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "ttypes.h"
#include "os.h"
#include "os.h"
#include "taos.h"
#include "taosdef.h"
#include "taosdef.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "tutil.h"
//
#include "tutil.h"
tDataTypeDescriptor
tDataTypeDesc
[
11
]
=
{
tDataTypeDescriptor
tDataTypeDesc
[
11
]
=
{
{
TSDB_DATA_TYPE_NULL
,
6
,
1
,
"NOTYPE"
},
{
TSDB_DATA_TYPE_NULL
,
6
,
1
,
"NOTYPE"
},
...
...
src/inc/taos.h
浏览文件 @
501c98c9
...
@@ -29,18 +29,6 @@ typedef void TAOS_SUB;
...
@@ -29,18 +29,6 @@ typedef void TAOS_SUB;
typedef
void
TAOS_STREAM
;
typedef
void
TAOS_STREAM
;
typedef
void
TAOS_STMT
;
typedef
void
TAOS_STMT
;
#define TSDB_DATA_TYPE_NULL 0
#define TSDB_DATA_TYPE_BOOL 1 // 1 bytes
#define TSDB_DATA_TYPE_TINYINT 2 // 1 byte
#define TSDB_DATA_TYPE_SMALLINT 3 // 2 bytes
#define TSDB_DATA_TYPE_INT 4 // 4 bytes
#define TSDB_DATA_TYPE_BIGINT 5 // 8 bytes
#define TSDB_DATA_TYPE_FLOAT 6 // 4 bytes
#define TSDB_DATA_TYPE_DOUBLE 7 // 8 bytes
#define TSDB_DATA_TYPE_BINARY 8 // string
#define TSDB_DATA_TYPE_TIMESTAMP 9 // 8 bytes
#define TSDB_DATA_TYPE_NCHAR 10 // multibyte string
typedef
enum
{
typedef
enum
{
TSDB_OPTION_LOCALE
,
TSDB_OPTION_LOCALE
,
TSDB_OPTION_CHARSET
,
TSDB_OPTION_CHARSET
,
...
...
src/inc/taosdef.h
浏览文件 @
501c98c9
...
@@ -21,7 +21,7 @@ extern "C" {
...
@@ -21,7 +21,7 @@ extern "C" {
#endif
#endif
#include <stdint.h>
#include <stdint.h>
#include
"tglobalcfg.h"
#include
<stdbool.h>
#define TSDB__packed
#define TSDB__packed
...
@@ -31,6 +31,42 @@ extern "C" {
...
@@ -31,6 +31,42 @@ extern "C" {
#define TSKEY int64_t
#define TSKEY int64_t
#endif
#endif
// Data type definition
#define TSDB_DATA_TYPE_NULL 0 // 1 bytes
#define TSDB_DATA_TYPE_BOOL 1 // 1 bytes
#define TSDB_DATA_TYPE_TINYINT 2 // 1 byte
#define TSDB_DATA_TYPE_SMALLINT 3 // 2 bytes
#define TSDB_DATA_TYPE_INT 4 // 4 bytes
#define TSDB_DATA_TYPE_BIGINT 5 // 8 bytes
#define TSDB_DATA_TYPE_FLOAT 6 // 4 bytes
#define TSDB_DATA_TYPE_DOUBLE 7 // 8 bytes
#define TSDB_DATA_TYPE_BINARY 8 // string
#define TSDB_DATA_TYPE_TIMESTAMP 9 // 8 bytes
#define TSDB_DATA_TYPE_NCHAR 10 // unicode string
// Bytes for each type.
#define CHAR_BYTES sizeof(char)
#define SHORT_BYTES sizeof(short)
#define INT_BYTES sizeof(int)
#define LONG_BYTES sizeof(int64_t)
#define FLOAT_BYTES sizeof(float)
#define DOUBLE_BYTES sizeof(double)
// NULL definition
#define TSDB_DATA_BOOL_NULL 0x02
#define TSDB_DATA_TINYINT_NULL 0x80
#define TSDB_DATA_SMALLINT_NULL 0x8000
#define TSDB_DATA_INT_NULL 0x80000000
#define TSDB_DATA_BIGINT_NULL 0x8000000000000000L
#define TSDB_DATA_FLOAT_NULL 0x7FF00000 // it is an NAN
#define TSDB_DATA_DOUBLE_NULL 0x7FFFFF0000000000L // an NAN
#define TSDB_DATA_NCHAR_NULL 0xFFFFFFFF
#define TSDB_DATA_BINARY_NULL 0xFF
#define TSDB_DATA_NULL_STR "NULL"
#define TSDB_DATA_NULL_STR_L "null"
#define TSDB_TRUE 1
#define TSDB_TRUE 1
#define TSDB_FALSE 0
#define TSDB_FALSE 0
#define TSDB_OK 0
#define TSDB_OK 0
...
@@ -44,16 +80,6 @@ extern "C" {
...
@@ -44,16 +80,6 @@ extern "C" {
#define TSDB_TIME_PRECISION_MILLI_STR "ms"
#define TSDB_TIME_PRECISION_MILLI_STR "ms"
#define TSDB_TIME_PRECISION_MICRO_STR "us"
#define TSDB_TIME_PRECISION_MICRO_STR "us"
#define TSDB_DATA_TYPE_BOOL 1 // 1 bytes
#define TSDB_DATA_TYPE_TINYINT 2 // 1 byte
#define TSDB_DATA_TYPE_SMALLINT 3 // 2 bytes
#define TSDB_DATA_TYPE_INT 4 // 4 bytes
#define TSDB_DATA_TYPE_BIGINT 5 // 8 bytes
#define TSDB_DATA_TYPE_FLOAT 6 // 4 bytes
#define TSDB_DATA_TYPE_DOUBLE 7 // 8 bytes
#define TSDB_DATA_TYPE_BINARY 8 // string
#define TSDB_DATA_TYPE_TIMESTAMP 9 // 8 bytes
#define TSDB_DATA_TYPE_NCHAR 10 // unicode string
#define TSDB_KEYSIZE sizeof(TSKEY)
#define TSDB_KEYSIZE sizeof(TSKEY)
...
@@ -64,6 +90,48 @@ extern "C" {
...
@@ -64,6 +90,48 @@ extern "C" {
#endif
#endif
//#define TSDB_CHAR_TERMINATED_SPACE 1
//#define TSDB_CHAR_TERMINATED_SPACE 1
#define GET_INT8_VAL(x) (*(int8_t *)(x))
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#ifdef _TD_ARM_32_
#define GET_FLOAT_VAL(x) taos_align_get_float(x)
#define GET_DOUBLE_VAL(x) taos_align_get_double(x)
float
taos_align_get_float
(
const
char
*
pBuf
);
double
taos_align_get_double
(
const
char
*
pBuf
);
//#define __float_align_declear() float __underlyFloat = 0.0;
//#define __float_align_declear()
//#define GET_FLOAT_VAL_ALIGN(x) (*(int32_t*)&(__underlyFloat) = *(int32_t*)(x); __underlyFloat);
// notes: src must be float or double type variable !!!
#define SET_FLOAT_VAL_ALIGN(dst, src) (*(int32_t*) dst = *(int32_t*)src);
#define SET_DOUBLE_VAL_ALIGN(dst, src) (*(int64_t*) dst = *(int64_t*)src);
#else
#define GET_FLOAT_VAL(x) (*(float *)(x))
#define GET_DOUBLE_VAL(x) (*(double *)(x))
#endif
typedef
struct
tDataTypeDescriptor
{
int16_t
nType
;
int16_t
nameLen
;
int32_t
nSize
;
char
*
aName
;
}
tDataTypeDescriptor
;
extern
tDataTypeDescriptor
tDataTypeDesc
[
11
];
#define POINTER_BYTES sizeof(void *) // 8 by default assert(sizeof(ptrdiff_t) == sizseof(void*)
bool
isValidDataType
(
int32_t
type
,
int32_t
length
);
bool
isNull
(
const
char
*
val
,
int32_t
type
);
void
setNull
(
char
*
val
,
int32_t
type
,
int32_t
bytes
);
void
setNullN
(
char
*
val
,
int32_t
type
,
int32_t
bytes
,
int32_t
numOfElems
);
void
assignVal
(
char
*
val
,
const
char
*
src
,
int32_t
len
,
int32_t
type
);
void
tsDataSwap
(
void
*
pLeft
,
void
*
pRight
,
int32_t
type
,
int32_t
size
);
// TODO: check if below is necessary
#define TSDB_RELATION_INVALID 0
#define TSDB_RELATION_INVALID 0
#define TSDB_RELATION_LESS 1
#define TSDB_RELATION_LESS 1
#define TSDB_RELATION_LARGE 2
#define TSDB_RELATION_LARGE 2
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
501c98c9
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "shellCommand.h"
#include "shellCommand.h"
#include "ttime.h"
#include "ttime.h"
#include "tutil.h"
#include "tutil.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "taoserror.h"
#include "taoserror.h"
#include <regex.h>
#include <regex.h>
...
...
src/query/inc/tast.h
浏览文件 @
501c98c9
...
@@ -23,7 +23,7 @@ extern "C" {
...
@@ -23,7 +23,7 @@ extern "C" {
#include "os.h"
#include "os.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tvariant.h"
#include "tvariant.h"
struct
tSQLBinaryExpr
;
struct
tSQLBinaryExpr
;
...
...
src/query/inc/tsqlfunction.h
浏览文件 @
501c98c9
...
@@ -24,7 +24,7 @@ extern "C" {
...
@@ -24,7 +24,7 @@ extern "C" {
#include <stdint.h>
#include <stdint.h>
#include "trpc.h"
#include "trpc.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tvariant.h"
#include "tvariant.h"
#define TSDB_FUNC_INVALID_ID -1
#define TSDB_FUNC_INVALID_ID -1
...
...
src/query/inc/tvariant.h
浏览文件 @
501c98c9
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
#ifndef TDENGINE_TVARIANT_H
#ifndef TDENGINE_TVARIANT_H
#define TDENGINE_TVARIANT_H
#define TDENGINE_TVARIANT_H
#include "tstoken.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
...
...
src/query/src/textbuffer.c
浏览文件 @
501c98c9
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "tlog.h"
#include "tlog.h"
#include "tsqlfunction.h"
#include "tsqlfunction.h"
#include "ttime.h"
#include "ttime.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
#define COLMODEL_GET_VAL(data, schema, allrow, rowId, colId) \
#define COLMODEL_GET_VAL(data, schema, allrow, rowId, colId) \
...
...
src/query/src/tinterpolation.c
浏览文件 @
501c98c9
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "textbuffer.h"
#include "textbuffer.h"
#include "tinterpolation.h"
#include "tinterpolation.h"
#include "tsqlfunction.h"
#include "tsqlfunction.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#define INTERPOL_IS_ASC_INTERPOL(interp) ((interp)->order == TSQL_SO_ASC)
#define INTERPOL_IS_ASC_INTERPOL(interp) ((interp)->order == TSQL_SO_ASC)
...
...
src/query/src/tpercentile.c
浏览文件 @
501c98c9
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "taosmsg.h"
#include "taosmsg.h"
#include "taosdef.h"
#include "taosdef.h"
#include "tlog.h"
#include "tlog.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tpercentile.h"
#include "tpercentile.h"
tExtMemBuffer
*
releaseBucketsExceptFor
(
tMemBucket
*
pMemBucket
,
int16_t
segIdx
,
int16_t
slotIdx
)
{
tExtMemBuffer
*
releaseBucketsExceptFor
(
tMemBucket
*
pMemBucket
,
int16_t
segIdx
,
int16_t
slotIdx
)
{
...
...
src/query/src/tscAst.c
浏览文件 @
501c98c9
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include "tsqlfunction.h"
#include "tsqlfunction.h"
#include "tstoken.h"
#include "tstoken.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
#include "qsqlparser.h"
#include "qsqlparser.h"
...
...
src/query/src/tscSQLParserImpl.c
浏览文件 @
501c98c9
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "tstoken.h"
#include "tstoken.h"
#include "ttime.h"
#include "ttime.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
int32_t
tSQLParse
(
SSqlInfo
*
pSQLInfo
,
const
char
*
pStr
)
{
int32_t
tSQLParse
(
SSqlInfo
*
pSQLInfo
,
const
char
*
pStr
)
{
...
...
src/query/src/tscSyntaxtreefunction.c
浏览文件 @
501c98c9
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include "os.h"
#include "os.h"
#include "tscSyntaxtreefunction.h"
#include "tscSyntaxtreefunction.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
#define ARRAY_LIST_OP(left, right, _left_type, _right_type, len1, len2, out, op, _res_type, _ord) \
#define ARRAY_LIST_OP(left, right, _left_type, _right_type, len1, len2, out, op, _res_type, _ord) \
...
...
src/query/src/ttokenizer.c
浏览文件 @
501c98c9
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "shash.h"
#include "shash.h"
#include "tstoken.h"
#include "tstoken.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
// All the keywords of the SQL language are stored in a hash table
// All the keywords of the SQL language are stored in a hash table
...
...
src/query/src/tvariant.c
浏览文件 @
501c98c9
...
@@ -19,10 +19,10 @@
...
@@ -19,10 +19,10 @@
#include "shash.h"
#include "shash.h"
#include "tstoken.h"
#include "tstoken.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
#include "tvariant.h"
#include "tvariant.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "taos.h"
#include "taos.h"
// todo support scientific expression number and oct number
// todo support scientific expression number and oct number
...
...
src/thirdparty/CMakeLists.txt
0 → 100644
浏览文件 @
501c98c9
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SOURCE_LIST
)
add_library
(
thirdparty
${
SOURCE_LIST
}
)
target_include_directories
(
thirdparty PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc
)
\ No newline at end of file
src/
util
/inc/lz4.h
→
src/
thirdparty
/inc/lz4.h
浏览文件 @
501c98c9
文件已移动
src/
util
/src/lz4.c
→
src/
thirdparty
/src/lz4.c
浏览文件 @
501c98c9
文件已移动
src/util/CMakeLists.txt
浏览文件 @
501c98c9
...
@@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
...
@@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
IF
((
TD_LINUX_64
)
OR
(
TD_LINUX_32 AND TD_ARM
))
IF
((
TD_LINUX_64
)
OR
(
TD_LINUX_32 AND TD_ARM
))
AUX_SOURCE_DIRECTORY
(
src SRC
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
tutil pthread os m rt
)
TARGET_LINK_LIBRARIES
(
tutil
thirdparty
pthread os m rt
)
IF
(
TD_CLUSTER
)
IF
(
TD_CLUSTER
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
TARGET_LINK_LIBRARIES
(
tutil iconv
)
TARGET_LINK_LIBRARIES
(
tutil iconv
)
...
@@ -68,7 +68,7 @@ ELSEIF (TD_WINDOWS_64)
...
@@ -68,7 +68,7 @@ ELSEIF (TD_WINDOWS_64)
LIST
(
APPEND SRC ./src/tutil.c
)
LIST
(
APPEND SRC ./src/tutil.c
)
LIST
(
APPEND SRC ./src/version.c
)
LIST
(
APPEND SRC ./src/version.c
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
tutil iconv regex pthread os winmm IPHLPAPI ws2_32
)
TARGET_LINK_LIBRARIES
(
tutil
thirdparty
iconv regex pthread os winmm IPHLPAPI ws2_32
)
ELSEIF
(
TD_DARWIN_64
)
ELSEIF
(
TD_DARWIN_64
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
LIST
(
APPEND SRC ./src/hash.c
)
LIST
(
APPEND SRC ./src/hash.c
)
...
@@ -105,7 +105,7 @@ ELSEIF(TD_DARWIN_64)
...
@@ -105,7 +105,7 @@ ELSEIF(TD_DARWIN_64)
LIST
(
APPEND SRC ./src/version.c
)
LIST
(
APPEND SRC ./src/version.c
)
LIST
(
APPEND SRC ./src/hash.c
)
LIST
(
APPEND SRC ./src/hash.c
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
tutil iconv pthread os
)
TARGET_LINK_LIBRARIES
(
tutil
thirdparty
iconv pthread os
)
ENDIF
()
ENDIF
()
#IF (TD_CLUSTER)
#IF (TD_CLUSTER)
...
...
src/util/inc/sskiplist.h
浏览文件 @
501c98c9
...
@@ -28,7 +28,7 @@ extern "C" {
...
@@ -28,7 +28,7 @@ extern "C" {
#include <stdlib.h>
#include <stdlib.h>
#include "os.h"
#include "os.h"
#include "t
types
.h"
#include "t
aosdef
.h"
/*
/*
* key of each node
* key of each node
...
...
src/util/inc/tskiplist.h
浏览文件 @
501c98c9
...
@@ -21,7 +21,7 @@ extern "C" {
...
@@ -21,7 +21,7 @@ extern "C" {
#endif
#endif
#include "os.h"
#include "os.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tarray.h"
#include "tarray.h"
/*
/*
...
...
src/util/inc/ttypes.h
已删除
100644 → 0
浏览文件 @
fcde3402
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_TTYPES_H
#define TDENGINE_TTYPES_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "tstoken.h"
// Bytes for each type.
#define CHAR_BYTES sizeof(char)
#define SHORT_BYTES sizeof(short)
#define INT_BYTES sizeof(int)
#define LONG_BYTES sizeof(int64_t)
#define FLOAT_BYTES sizeof(float)
#define DOUBLE_BYTES sizeof(double)
#define POINTER_BYTES sizeof(void *) // 8 by default assert(sizeof(ptrdiff_t) == sizseof(void*)
#define TSDB_DATA_BOOL_NULL 0x02
#define TSDB_DATA_TINYINT_NULL 0x80
#define TSDB_DATA_SMALLINT_NULL 0x8000
#define TSDB_DATA_INT_NULL 0x80000000
#define TSDB_DATA_BIGINT_NULL 0x8000000000000000L
#define TSDB_DATA_FLOAT_NULL 0x7FF00000 // it is an NAN
#define TSDB_DATA_DOUBLE_NULL 0x7FFFFF0000000000L // an NAN
#define TSDB_DATA_NCHAR_NULL 0xFFFFFFFF
#define TSDB_DATA_BINARY_NULL 0xFF
#define TSDB_DATA_NULL_STR "NULL"
#define TSDB_DATA_NULL_STR_L "null"
typedef
struct
tDataTypeDescriptor
{
int16_t
nType
;
int16_t
nameLen
;
int32_t
nSize
;
char
*
aName
;
}
tDataTypeDescriptor
;
extern
tDataTypeDescriptor
tDataTypeDesc
[
11
];
bool
isValidDataType
(
int32_t
type
,
int32_t
length
);
bool
isNull
(
const
char
*
val
,
int32_t
type
);
void
setNull
(
char
*
val
,
int32_t
type
,
int32_t
bytes
);
void
setNullN
(
char
*
val
,
int32_t
type
,
int32_t
bytes
,
int32_t
numOfElems
);
void
assignVal
(
char
*
val
,
const
char
*
src
,
int32_t
len
,
int32_t
type
);
void
tsDataSwap
(
void
*
pLeft
,
void
*
pRight
,
int32_t
type
,
int32_t
size
);
#ifdef __cplusplus
}
#endif
#endif // TDENGINE_TTYPES_H
src/util/inc/tutil.h
浏览文件 @
501c98c9
...
@@ -93,29 +93,6 @@ extern "C" {
...
@@ -93,29 +93,6 @@ extern "C" {
} \
} \
} while (0)
} while (0)
#define GET_INT8_VAL(x) (*(int8_t *)(x))
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#ifdef _TD_ARM_32_
#define GET_FLOAT_VAL(x) taos_align_get_float(x)
#define GET_DOUBLE_VAL(x) taos_align_get_double(x)
float
taos_align_get_float
(
const
char
*
pBuf
);
double
taos_align_get_double
(
const
char
*
pBuf
);
//#define __float_align_declear() float __underlyFloat = 0.0;
//#define __float_align_declear()
//#define GET_FLOAT_VAL_ALIGN(x) (*(int32_t*)&(__underlyFloat) = *(int32_t*)(x); __underlyFloat);
// notes: src must be float or double type variable !!!
#define SET_FLOAT_VAL_ALIGN(dst, src) (*(int32_t*) dst = *(int32_t*)src);
#define SET_DOUBLE_VAL_ALIGN(dst, src) (*(int64_t*) dst = *(int64_t*)src);
#else
#define GET_FLOAT_VAL(x) (*(float *)(x))
#define GET_DOUBLE_VAL(x) (*(double *)(x))
#endif
#define ALIGN_NUM(n, align) (((n) + ((align)-1)) & (~((align)-1)))
#define ALIGN_NUM(n, align) (((n) + ((align)-1)) & (~((align)-1)))
// align to 8bytes
// align to 8bytes
...
...
src/util/src/tcompression.c
浏览文件 @
501c98c9
...
@@ -51,7 +51,6 @@
...
@@ -51,7 +51,6 @@
#include "lz4.h"
#include "lz4.h"
#include "tscompression.h"
#include "tscompression.h"
#include "taosdef.h"
#include "taosdef.h"
#include "ttypes.h"
const
int
TEST_NUMBER
=
1
;
const
int
TEST_NUMBER
=
1
;
#define is_bigendian() ((*(char *)&TEST_NUMBER) == 0)
#define is_bigendian() ((*(char *)&TEST_NUMBER) == 0)
...
...
src/util/src/tutil.c
浏览文件 @
501c98c9
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "tcrc32c.h"
#include "tcrc32c.h"
#include "tglobalcfg.h"
#include "tglobalcfg.h"
#include "ttime.h"
#include "ttime.h"
#include "t
types
.h"
#include "t
aosdef
.h"
#include "tutil.h"
#include "tutil.h"
#include "tlog.h"
#include "tlog.h"
#include "taoserror.h"
#include "taoserror.h"
...
...
src/vnode/CMakeLists.txt
浏览文件 @
501c98c9
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
PROJECT
(
TDengine
)
PROJECT
(
TDengine
)
ADD_SUBDIRECTORY
(
common
)
#
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY
(
tsdb
)
ADD_SUBDIRECTORY
(
tsdb
)
# ENABLE_TESTING()
# ENABLE_TESTING()
# ADD_SUBDIRECTORY(tests)
# ADD_SUBDIRECTORY(tests)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录