Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
99c6d1ec
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1181
Star
22014
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,发现更多精彩内容 >>
提交
99c6d1ec
编写于
11月 28, 2019
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/mergeimport
上级
ed253f2a
7ed65adb
变更
43
展开全部
隐藏空白更改
内联
并排
Showing
43 changed file
with
2795 addition
and
2666 deletion
+2795
-2666
CMakeLists.txt
CMakeLists.txt
+3
-1
packaging/cfg/taos.cfg
packaging/cfg/taos.cfg
+6
-0
src/client/inc/tscSQLParser.h
src/client/inc/tscSQLParser.h
+1
-0
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+40
-47
src/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h
src/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h
+16
-0
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+14
-0
src/client/src/sql.c
src/client/src/sql.c
+1268
-1665
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+3
-3
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+83
-121
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+276
-459
src/client/src/tscSQLParserImpl.c
src/client/src/tscSQLParserImpl.c
+1
-1
src/client/src/tscSchemaUtil.c
src/client/src/tscSchemaUtil.c
+1
-0
src/client/src/tscServer.c
src/client/src/tscServer.c
+4
-31
src/client/src/tscSql.c
src/client/src/tscSql.c
+18
-10
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+26
-2
src/connector/go/src/taosSql/utils.go
src/connector/go/src/taosSql/utils.go
+23
-1
src/inc/sql.y
src/inc/sql.y
+4
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+2
-2
src/inc/tglobalcfg.h
src/inc/tglobalcfg.h
+2
-0
src/inc/tnote.h
src/inc/tnote.h
+0
-1
src/inc/tsqldef.h
src/inc/tsqldef.h
+139
-140
src/inc/tutil.h
src/inc/tutil.h
+29
-12
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+1
-0
src/os/linux/src/tsystem.c
src/os/linux/src/tsystem.c
+4
-1
src/os/windows/inc/os.h
src/os/windows/inc/os.h
+21
-9
src/os/windows/src/twindows.c
src/os/windows/src/twindows.c
+3
-1
src/rpc/src/trpc.c
src/rpc/src/trpc.c
+108
-21
src/sdb/src/sdbEngine.c
src/sdb/src/sdbEngine.c
+79
-27
src/system/detail/inc/mgmt.h
src/system/detail/inc/mgmt.h
+3
-0
src/system/detail/inc/vnode.h
src/system/detail/inc/vnode.h
+1
-1
src/system/detail/src/dnodeService.c
src/system/detail/src/dnodeService.c
+14
-0
src/system/detail/src/mgmtDnode.c
src/system/detail/src/mgmtDnode.c
+118
-0
src/system/detail/src/mgmtMeter.c
src/system/detail/src/mgmtMeter.c
+1
-3
src/system/detail/src/mgmtShell.c
src/system/detail/src/mgmtShell.c
+2
-0
src/system/detail/src/vnodeFile.c
src/system/detail/src/vnodeFile.c
+1
-0
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+16
-34
src/system/detail/src/vnodeRead.c
src/system/detail/src/vnodeRead.c
+5
-12
src/system/detail/src/vnodeShell.c
src/system/detail/src/vnodeShell.c
+22
-21
src/util/CMakeLists.txt
src/util/CMakeLists.txt
+0
-3
src/util/src/tglobalcfg.c
src/util/src/tglobalcfg.c
+1
-0
src/util/src/tmem.c
src/util/src/tmem.c
+433
-34
src/util/src/ttokenizer.c
src/util/src/ttokenizer.c
+1
-0
src/util/src/version.c
src/util/src/version.c
+2
-2
未找到文件。
CMakeLists.txt
浏览文件 @
99c6d1ec
...
@@ -125,7 +125,9 @@ IF (NOT DEFINED TD_CLUSTER)
...
@@ -125,7 +125,9 @@ IF (NOT DEFINED TD_CLUSTER)
# debug flag
# debug flag
#
#
# ADD_DEFINITIONS(-D_CHECK_HEADER_FILE_)
# ADD_DEFINITIONS(-D_CHECK_HEADER_FILE_)
# ADD_DEFINITIONS(-D_TAOS_MEM_TEST_)
IF
(
${
MEM_CHECK
}
MATCHES
"true"
)
ADD_DEFINITIONS
(
-DTAOS_MEM_CHECK
)
ENDIF
()
IF
(
TD_CLUSTER
)
IF
(
TD_CLUSTER
)
ADD_DEFINITIONS
(
-DCLUSTER
)
ADD_DEFINITIONS
(
-DCLUSTER
)
...
...
packaging/cfg/taos.cfg
浏览文件 @
99c6d1ec
...
@@ -58,6 +58,12 @@
...
@@ -58,6 +58,12 @@
# The server and client should have the same socket type. Otherwise, connect will fail.
# The server and client should have the same socket type. Otherwise, connect will fail.
# sockettype udp
# sockettype udp
# The compressed rpc message, option:
# -1 (no compression)
# 0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize -1
# RPC re-try timer, millisecond
# RPC re-try timer, millisecond
# rpcTimer 300
# rpcTimer 300
...
...
src/client/inc/tscSQLParser.h
浏览文件 @
99c6d1ec
...
@@ -105,6 +105,7 @@ enum TSQL_TYPE {
...
@@ -105,6 +105,7 @@ enum TSQL_TYPE {
SHOW_MODULES
=
0x6c
,
SHOW_MODULES
=
0x6c
,
SHOW_CONNECTIONS
=
0x6d
,
SHOW_CONNECTIONS
=
0x6d
,
SHOW_GRANTS
=
0x6e
,
SHOW_GRANTS
=
0x6e
,
SHOW_VNODES
=
0x6f
,
// create dnode
// create dnode
CREATE_DNODE
=
0x80
,
CREATE_DNODE
=
0x80
,
...
...
src/client/inc/tsclient.h
浏览文件 @
99c6d1ec
...
@@ -34,8 +34,8 @@ extern "C" {
...
@@ -34,8 +34,8 @@ extern "C" {
#include "tglobalcfg.h"
#include "tglobalcfg.h"
#include "tlog.h"
#include "tlog.h"
#include "tscCache.h"
#include "tscCache.h"
#include "tsdb.h"
#include "tscSQLParser.h"
#include "tscSQLParser.h"
#include "tsdb.h"
#include "tsqlfunction.h"
#include "tsqlfunction.h"
#include "tutil.h"
#include "tutil.h"
...
@@ -219,22 +219,22 @@ typedef struct STagCond {
...
@@ -219,22 +219,22 @@ typedef struct STagCond {
}
STagCond
;
}
STagCond
;
typedef
struct
SParamInfo
{
typedef
struct
SParamInfo
{
int32_t
idx
;
int32_t
idx
;
char
type
;
char
type
;
uint8_t
timePrec
;
uint8_t
timePrec
;
short
bytes
;
short
bytes
;
uint32_t
offset
;
uint32_t
offset
;
}
SParamInfo
;
}
SParamInfo
;
typedef
struct
STableDataBlocks
{
typedef
struct
STableDataBlocks
{
char
meterId
[
TSDB_METER_ID_LEN
];
char
meterId
[
TSDB_METER_ID_LEN
];
int8_t
tsSource
;
int8_t
tsSource
;
bool
ordered
;
bool
ordered
;
int64_t
vgid
;
int64_t
vgid
;
int64_t
prevTS
;
int64_t
prevTS
;
int32_t
numOfMeters
;
int32_t
numOfMeters
;
int32_t
rowSize
;
int32_t
rowSize
;
uint32_t
nAllocSize
;
uint32_t
nAllocSize
;
...
@@ -245,9 +245,9 @@ typedef struct STableDataBlocks {
...
@@ -245,9 +245,9 @@ typedef struct STableDataBlocks {
};
};
// for parameter ('?') binding
// for parameter ('?') binding
uint32_t
numOfAllocedParams
;
uint32_t
numOfAllocedParams
;
uint32_t
numOfParams
;
uint32_t
numOfParams
;
SParamInfo
*
params
;
SParamInfo
*
params
;
}
STableDataBlocks
;
}
STableDataBlocks
;
typedef
struct
SDataBlockList
{
typedef
struct
SDataBlockList
{
...
@@ -262,18 +262,17 @@ typedef struct SDataBlockList {
...
@@ -262,18 +262,17 @@ typedef struct SDataBlockList {
typedef
struct
{
typedef
struct
{
SOrderVal
order
;
SOrderVal
order
;
int
command
;
int
command
;
int
count
;
// TODO refactor
// TODO refactor
int
count
;
int16_t
isInsertFromFile
;
// load data from file or not
union
{
union
{
bool
existsCheck
;
bool
existsCheck
;
// check if the table exists
int8_t
showType
;
int8_t
showType
;
// show command type
};
};
int8_t
isInsertFromFile
;
// load data from file or not
bool
import
;
// import/insert type
char
msgType
;
char
msgType
;
uint16_t
type
;
uint16_t
type
;
// query type
char
intervalTimeUnit
;
char
intervalTimeUnit
;
int64_t
etime
,
stime
;
int64_t
etime
,
stime
;
int64_t
nAggTimeInterval
;
// aggregation time interval
int64_t
nAggTimeInterval
;
// aggregation time interval
...
@@ -286,20 +285,20 @@ typedef struct {
...
@@ -286,20 +285,20 @@ typedef struct {
*
*
* In such cases, allocate the memory dynamically, and need to free the memory
* In such cases, allocate the memory dynamically, and need to free the memory
*/
*/
uint32_t
allocSize
;
uint32_t
allocSize
;
char
*
payload
;
char
*
payload
;
int
payloadLen
;
int
payloadLen
;
short
numOfCols
;
short
numOfCols
;
SColumnBaseInfo
colList
;
SColumnBaseInfo
colList
;
SFieldInfo
fieldsInfo
;
SFieldInfo
fieldsInfo
;
SSqlExprInfo
exprsInfo
;
SSqlExprInfo
exprsInfo
;
SLimitVal
limit
;
SLimitVal
limit
;
SLimitVal
slimit
;
SLimitVal
slimit
;
int64_t
globalLimit
;
int64_t
globalLimit
;
STagCond
tagCond
;
STagCond
tagCond
;
int16_t
vnodeIdx
;
// vnode index in pMetricMeta for metric query
int16_t
vnodeIdx
;
// vnode index in pMetricMeta for metric query
int16_t
interpoType
;
// interpolate type
int16_t
interpoType
;
// interpolate type
int16_t
numOfTables
;
int16_t
numOfTables
;
// submit data blocks branched according to vnode
// submit data blocks branched according to vnode
SDataBlockList
*
pDataBlocks
;
SDataBlockList
*
pDataBlocks
;
...
@@ -430,11 +429,11 @@ int tsParseSql(SSqlObj *pSql, char *acct, char *db, bool multiVnodeInsertion);
...
@@ -430,11 +429,11 @@ int tsParseSql(SSqlObj *pSql, char *acct, char *db, bool multiVnodeInsertion);
void
tscInitMsgs
();
void
tscInitMsgs
();
void
*
tscProcessMsgFromServer
(
char
*
msg
,
void
*
ahandle
,
void
*
thandle
);
void
*
tscProcessMsgFromServer
(
char
*
msg
,
void
*
ahandle
,
void
*
thandle
);
int
tscProcessSql
(
SSqlObj
*
pSql
);
int
tscProcessSql
(
SSqlObj
*
pSql
);
void
tscAsyncInsertMultiVnodesProxy
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
void
tscAsyncInsertMultiVnodesProxy
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
int
tscRenewMeterMeta
(
SSqlObj
*
pSql
,
char
*
meterId
);
int
tscRenewMeterMeta
(
SSqlObj
*
pSql
,
char
*
meterId
);
void
tscQueueAsyncRes
(
SSqlObj
*
pSql
);
void
tscQueueAsyncRes
(
SSqlObj
*
pSql
);
void
tscQueueAsyncError
(
void
(
*
fp
),
void
*
param
);
void
tscQueueAsyncError
(
void
(
*
fp
),
void
*
param
);
...
@@ -448,18 +447,12 @@ int taos_retrieve(TAOS_RES *res);
...
@@ -448,18 +447,12 @@ int taos_retrieve(TAOS_RES *res);
* before send query message to vnode
* before send query message to vnode
*/
*/
int32_t
tscTansformSQLFunctionForMetricQuery
(
SSqlCmd
*
pCmd
);
int32_t
tscTansformSQLFunctionForMetricQuery
(
SSqlCmd
*
pCmd
);
void
tscRestoreSQLFunctionForMetricQuery
(
SSqlCmd
*
pCmd
);
void
tscRestoreSQLFunctionForMetricQuery
(
SSqlCmd
*
pCmd
);
/**
* release both metric/meter meta information
* @param pCmd SSqlCmd object that contains the metric/meter meta info
*/
void
tscClearSqlMetaInfo
(
SSqlCmd
*
pCmd
);
void
tscClearSqlMetaInfoForce
(
SSqlCmd
*
pCmd
);
void
tscClearSqlMetaInfoForce
(
SSqlCmd
*
pCmd
);
int32_t
tscCreateResPointerInfo
(
SSqlCmd
*
pCmd
,
SSqlRes
*
pRes
);
int32_t
tscCreateResPointerInfo
(
SSqlCmd
*
pCmd
,
SSqlRes
*
pRes
);
void
tscDestroyResPointerInfo
(
SSqlRes
*
pRes
);
void
tscDestroyResPointerInfo
(
SSqlRes
*
pRes
);
void
tscFreeSqlCmdData
(
SSqlCmd
*
pCmd
);
void
tscFreeSqlCmdData
(
SSqlCmd
*
pCmd
);
...
@@ -479,12 +472,12 @@ void tscFreeSqlObj(SSqlObj *pObj);
...
@@ -479,12 +472,12 @@ void tscFreeSqlObj(SSqlObj *pObj);
void
tscCloseTscObj
(
STscObj
*
pObj
);
void
tscCloseTscObj
(
STscObj
*
pObj
);
void
tscProcessMultiVnodesInsert
(
SSqlObj
*
pSql
);
void
tscProcessMultiVnodesInsert
(
SSqlObj
*
pSql
);
void
tscProcessMultiVnodesInsertForFile
(
SSqlObj
*
pSql
);
void
tscProcessMultiVnodesInsertForFile
(
SSqlObj
*
pSql
);
void
tscKillMetricQuery
(
SSqlObj
*
pSql
);
void
tscKillMetricQuery
(
SSqlObj
*
pSql
);
void
tscInitResObjForLocalQuery
(
SSqlObj
*
pObj
,
int32_t
numOfRes
,
int32_t
rowLen
);
void
tscInitResObjForLocalQuery
(
SSqlObj
*
pObj
,
int32_t
numOfRes
,
int32_t
rowLen
);
int32_t
tscBuildResultsForEmptyRetrieval
(
SSqlObj
*
pSql
);
bool
tscIsUpdateQuery
(
STscObj
*
pObj
);
bool
tscIsUpdateQuery
(
STscObj
*
pObj
);
int32_t
tscInvalidSQLErrMsg
(
char
*
msg
,
const
char
*
additionalInfo
,
const
char
*
sql
);
// transfer SSqlInfo to SqlCmd struct
// transfer SSqlInfo to SqlCmd struct
int32_t
tscToSQLCmd
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
);
int32_t
tscToSQLCmd
(
SSqlObj
*
pSql
,
struct
SSqlInfo
*
pInfo
);
...
...
src/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h
浏览文件 @
99c6d1ec
...
@@ -9,6 +9,22 @@ extern "C" {
...
@@ -9,6 +9,22 @@ extern "C" {
#endif
#endif
#undef com_taosdata_jdbc_TSDBJNIConnector_INVALID_CONNECTION_POINTER_VALUE
#undef com_taosdata_jdbc_TSDBJNIConnector_INVALID_CONNECTION_POINTER_VALUE
#define com_taosdata_jdbc_TSDBJNIConnector_INVALID_CONNECTION_POINTER_VALUE 0LL
#define com_taosdata_jdbc_TSDBJNIConnector_INVALID_CONNECTION_POINTER_VALUE 0LL
/*
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Method:
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_setAllocModeImp
(
JNIEnv
*
,
jclass
,
jint
,
jstring
,
jboolean
);
/*
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Method:
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_dumpMemoryLeakImp
(
JNIEnv
*
,
jclass
);
/*
/*
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Class: com_taosdata_jdbc_TSDBJNIConnector
* Method: initImp
* Method: initImp
...
...
src/client/src/TSDBJNIConnector.c
浏览文件 @
99c6d1ec
...
@@ -111,6 +111,20 @@ void jniGetGlobalMethod(JNIEnv *env) {
...
@@ -111,6 +111,20 @@ void jniGetGlobalMethod(JNIEnv *env) {
jniTrace
(
"native method register finished"
);
jniTrace
(
"native method register finished"
);
}
}
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_setAllocModeImp
(
JNIEnv
*
env
,
jobject
jobj
,
jint
jMode
,
jstring
jPath
,
jboolean
jAutoDump
)
{
if
(
jPath
!=
NULL
)
{
const
char
*
path
=
(
*
env
)
->
GetStringUTFChars
(
env
,
jPath
,
NULL
);
taosSetAllocMode
(
jMode
,
path
,
!!
jAutoDump
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
jPath
,
path
);
}
else
{
taosSetAllocMode
(
jMode
,
NULL
,
!!
jAutoDump
);
}
}
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_dumpMemoryLeakImp
(
JNIEnv
*
env
,
jobject
jobj
)
{
taosDumpMemoryLeak
();
}
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_initImp
(
JNIEnv
*
env
,
jobject
jobj
,
jstring
jconfigDir
)
{
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_initImp
(
JNIEnv
*
env
,
jobject
jobj
,
jstring
jconfigDir
)
{
if
(
jconfigDir
!=
NULL
)
{
if
(
jconfigDir
!=
NULL
)
{
const
char
*
confDir
=
(
*
env
)
->
GetStringUTFChars
(
env
,
jconfigDir
,
NULL
);
const
char
*
confDir
=
(
*
env
)
->
GetStringUTFChars
(
env
,
jconfigDir
,
NULL
);
...
...
src/client/src/sql.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/client/src/tscAsync.c
浏览文件 @
99c6d1ec
...
@@ -40,6 +40,7 @@ static void tscProcessAsyncRetrieveImpl(void *param, TAOS_RES *tres, int numOfRo
...
@@ -40,6 +40,7 @@ static void tscProcessAsyncRetrieveImpl(void *param, TAOS_RES *tres, int numOfRo
*/
*/
static
void
tscProcessAsyncFetchRowsProxy
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
static
void
tscProcessAsyncFetchRowsProxy
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
// TODO return the correct error code to client in tscQueueAsyncError
void
taos_query_a
(
TAOS
*
taos
,
const
char
*
sqlstr
,
void
(
*
fp
)(
void
*
,
TAOS_RES
*
,
int
),
void
*
param
)
{
void
taos_query_a
(
TAOS
*
taos
,
const
char
*
sqlstr
,
void
(
*
fp
)(
void
*
,
TAOS_RES
*
,
int
),
void
*
param
)
{
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
if
(
pObj
==
NULL
||
pObj
->
signature
!=
pObj
)
{
if
(
pObj
==
NULL
||
pObj
->
signature
!=
pObj
)
{
...
@@ -54,18 +55,17 @@ void taos_query_a(TAOS *taos, const char *sqlstr, void (*fp)(void *, TAOS_RES *,
...
@@ -54,18 +55,17 @@ void taos_query_a(TAOS *taos, const char *sqlstr, void (*fp)(void *, TAOS_RES *,
tscError
(
"sql string too long"
);
tscError
(
"sql string too long"
);
tscQueueAsyncError
(
fp
,
param
);
tscQueueAsyncError
(
fp
,
param
);
return
;
return
;
}
}
taosNotePrintTsc
(
sqlstr
);
taosNotePrintTsc
(
sqlstr
);
SSqlObj
*
pSql
=
(
SSqlObj
*
)
malloc
(
sizeof
(
SSqlObj
));
SSqlObj
*
pSql
=
(
SSqlObj
*
)
calloc
(
1
,
sizeof
(
SSqlObj
));
if
(
pSql
==
NULL
)
{
if
(
pSql
==
NULL
)
{
tscError
(
"failed to malloc sqlObj"
);
tscError
(
"failed to malloc sqlObj"
);
tscQueueAsyncError
(
fp
,
param
);
tscQueueAsyncError
(
fp
,
param
);
return
;
return
;
}
}
memset
(
pSql
,
0
,
sizeof
(
SSqlObj
));
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
...
...
src/client/src/tscParseInsert.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/client/src/tscSQLParser.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/client/src/tscSQLParserImpl.c
浏览文件 @
99c6d1ec
...
@@ -746,7 +746,7 @@ void setCreateAcctSQL(SSqlInfo *pInfo, int32_t type, SSQLToken *pName, SSQLToken
...
@@ -746,7 +746,7 @@ void setCreateAcctSQL(SSqlInfo *pInfo, int32_t type, SSQLToken *pName, SSQLToken
}
}
void
setDefaultCreateDbOption
(
SCreateDBInfo
*
pDBInfo
)
{
void
setDefaultCreateDbOption
(
SCreateDBInfo
*
pDBInfo
)
{
pDBInfo
->
numOfBlocksPerTable
=
-
1
;
pDBInfo
->
numOfBlocksPerTable
=
50
;
pDBInfo
->
compressionLevel
=
-
1
;
pDBInfo
->
compressionLevel
=
-
1
;
pDBInfo
->
commitLog
=
-
1
;
pDBInfo
->
commitLog
=
-
1
;
...
...
src/client/src/tscSchemaUtil.c
浏览文件 @
99c6d1ec
...
@@ -123,6 +123,7 @@ bool tsMeterMetaIdentical(SMeterMeta* p1, SMeterMeta* p2) {
...
@@ -123,6 +123,7 @@ bool tsMeterMetaIdentical(SMeterMeta* p1, SMeterMeta* p2) {
return
memcmp
(
p1
,
p2
,
size
)
==
0
;
return
memcmp
(
p1
,
p2
,
size
)
==
0
;
}
}
//todo refactor
static
FORCE_INLINE
char
*
skipSegments
(
char
*
input
,
char
delimiter
,
int32_t
num
)
{
static
FORCE_INLINE
char
*
skipSegments
(
char
*
input
,
char
delimiter
,
int32_t
num
)
{
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
while
(
*
input
!=
0
&&
*
input
++
!=
delimiter
)
{
while
(
*
input
!=
0
&&
*
input
++
!=
delimiter
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
99c6d1ec
...
@@ -1415,7 +1415,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql) {
...
@@ -1415,7 +1415,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql) {
pMsg
=
pStart
;
pMsg
=
pStart
;
pShellMsg
=
(
SShellSubmitMsg
*
)
pMsg
;
pShellMsg
=
(
SShellSubmitMsg
*
)
pMsg
;
pShellMsg
->
import
=
pSql
->
cmd
.
order
.
order
;
pShellMsg
->
import
=
pSql
->
cmd
.
import
;
pShellMsg
->
vnode
=
htons
(
pMeterMeta
->
vpeerDesc
[
pMeterMeta
->
index
].
vnode
);
pShellMsg
->
vnode
=
htons
(
pMeterMeta
->
vpeerDesc
[
pMeterMeta
->
index
].
vnode
);
pShellMsg
->
numOfSid
=
htonl
(
pSql
->
cmd
.
count
);
// number of meters to be inserted
pShellMsg
->
numOfSid
=
htonl
(
pSql
->
cmd
.
count
);
// number of meters to be inserted
...
@@ -2175,7 +2175,7 @@ int tscBuildShowMsg(SSqlObj *pSql) {
...
@@ -2175,7 +2175,7 @@ int tscBuildShowMsg(SSqlObj *pSql) {
pShowMsg
=
(
SShowMsg
*
)
pMsg
;
pShowMsg
=
(
SShowMsg
*
)
pMsg
;
pShowMsg
->
type
=
pCmd
->
showType
;
pShowMsg
->
type
=
pCmd
->
showType
;
if
((
pShowMsg
->
type
==
TSDB_MGMT_TABLE_TABLE
||
pShowMsg
->
type
==
TSDB_MGMT_TABLE_METRIC
)
&&
pCmd
->
payloadLen
!=
0
)
{
if
((
pShowMsg
->
type
==
TSDB_MGMT_TABLE_TABLE
||
pShowMsg
->
type
==
TSDB_MGMT_TABLE_METRIC
||
pShowMsg
->
type
==
TSDB_MGMT_TABLE_VNODES
)
&&
pCmd
->
payloadLen
!=
0
)
{
// only show tables support wildcard query
// only show tables support wildcard query
pShowMsg
->
payloadLen
=
htons
(
pCmd
->
payloadLen
);
pShowMsg
->
payloadLen
=
htons
(
pCmd
->
payloadLen
);
memcpy
(
pShowMsg
->
payload
,
payload
,
pCmd
->
payloadLen
);
memcpy
(
pShowMsg
->
payload
,
payload
,
pCmd
->
payloadLen
);
...
@@ -3453,31 +3453,6 @@ int tscProcessQueryRsp(SSqlObj *pSql) {
...
@@ -3453,31 +3453,6 @@ int tscProcessQueryRsp(SSqlObj *pSql) {
return
0
;
return
0
;
}
}
static
void
doDecompressPayload
(
SSqlCmd
*
pCmd
,
SSqlRes
*
pRes
,
int16_t
compressed
)
{
if
(
compressed
&&
pRes
->
numOfRows
>
0
)
{
SRetrieveMeterRsp
*
pRetrieve
=
(
SRetrieveMeterRsp
*
)
pRes
->
pRsp
;
int32_t
numOfTotalCols
=
pCmd
->
fieldsInfo
.
numOfOutputCols
+
pCmd
->
fieldsInfo
.
numOfHiddenCols
;
int32_t
rowSize
=
pCmd
->
fieldsInfo
.
pOffset
[
numOfTotalCols
-
1
]
+
pCmd
->
fieldsInfo
.
pFields
[
numOfTotalCols
-
1
].
bytes
;
// TODO handle the OOM problem
char
*
buf
=
malloc
(
rowSize
*
pRes
->
numOfRows
);
int32_t
payloadSize
=
pRes
->
rspLen
-
1
-
sizeof
(
SRetrieveMeterRsp
);
assert
(
payloadSize
>
0
);
int32_t
decompressedSize
=
tsDecompressString
(
pRetrieve
->
data
,
payloadSize
,
1
,
buf
,
rowSize
*
pRes
->
numOfRows
,
0
,
0
,
0
);
assert
(
decompressedSize
==
rowSize
*
pRes
->
numOfRows
);
pRes
->
pRsp
=
realloc
(
pRes
->
pRsp
,
pRes
->
rspLen
-
payloadSize
+
decompressedSize
);
memcpy
(
pRes
->
pRsp
+
sizeof
(
SRetrieveMeterRsp
),
buf
,
decompressedSize
);
free
(
buf
);
}
pRes
->
data
=
((
SRetrieveMeterRsp
*
)
pRes
->
pRsp
)
->
data
;
}
int
tscProcessRetrieveRspFromVnode
(
SSqlObj
*
pSql
)
{
int
tscProcessRetrieveRspFromVnode
(
SSqlObj
*
pSql
)
{
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
...
@@ -3490,9 +3465,7 @@ int tscProcessRetrieveRspFromVnode(SSqlObj *pSql) {
...
@@ -3490,9 +3465,7 @@ int tscProcessRetrieveRspFromVnode(SSqlObj *pSql) {
pRes
->
offset
=
htobe64
(
pRetrieve
->
offset
);
pRes
->
offset
=
htobe64
(
pRetrieve
->
offset
);
pRes
->
useconds
=
htobe64
(
pRetrieve
->
useconds
);
pRes
->
useconds
=
htobe64
(
pRetrieve
->
useconds
);
pRetrieve
->
compress
=
htons
(
pRetrieve
->
compress
);
pRes
->
data
=
pRetrieve
->
data
;
doDecompressPayload
(
pCmd
,
pRes
,
pRetrieve
->
compress
);
tscSetResultPointer
(
pCmd
,
pRes
);
tscSetResultPointer
(
pCmd
,
pRes
);
pRes
->
row
=
0
;
pRes
->
row
=
0
;
...
@@ -3652,7 +3625,7 @@ int tscRenewMeterMeta(SSqlObj *pSql, char *meterId) {
...
@@ -3652,7 +3625,7 @@ int tscRenewMeterMeta(SSqlObj *pSql, char *meterId) {
*/
*/
if
(
pMeterMetaInfo
->
pMeterMeta
==
NULL
||
!
tscQueryOnMetric
(
pCmd
))
{
if
(
pMeterMetaInfo
->
pMeterMeta
==
NULL
||
!
tscQueryOnMetric
(
pCmd
))
{
if
(
pMeterMetaInfo
->
pMeterMeta
)
{
if
(
pMeterMetaInfo
->
pMeterMeta
)
{
tscTrace
(
"%p update meter meta, old: numOfTags:%d, numOfCols:%d, uid:%d, addr:%p"
,
pSql
,
tscTrace
(
"%p update meter meta, old: numOfTags:%d, numOfCols:%d, uid:%
ll
d, addr:%p"
,
pSql
,
pMeterMetaInfo
->
numOfTags
,
pCmd
->
numOfCols
,
pMeterMetaInfo
->
pMeterMeta
->
uid
,
pMeterMetaInfo
->
pMeterMeta
);
pMeterMetaInfo
->
numOfTags
,
pCmd
->
numOfCols
,
pMeterMetaInfo
->
pMeterMeta
->
uid
,
pMeterMetaInfo
->
pMeterMeta
);
}
}
tscWaitingForCreateTable
(
&
pSql
->
cmd
);
tscWaitingForCreateTable
(
&
pSql
->
cmd
);
...
...
src/client/src/tscSql.c
浏览文件 @
99c6d1ec
...
@@ -246,7 +246,12 @@ int taos_query_imp(STscObj* pObj, SSqlObj* pSql) {
...
@@ -246,7 +246,12 @@ int taos_query_imp(STscObj* pObj, SSqlObj* pSql) {
tscDoQuery
(
pSql
);
tscDoQuery
(
pSql
);
}
}
tscTrace
(
"%p SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
pObj
),
pObj
);
if
(
pRes
->
code
==
TSDB_CODE_SUCCESS
)
{
tscTrace
(
"%p SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
pObj
),
pObj
);
}
else
{
tscError
(
"%p SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
pObj
),
pObj
);
}
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlObjPartial
(
pSql
);
tscFreeSqlObjPartial
(
pSql
);
}
}
...
@@ -266,8 +271,9 @@ int taos_query(TAOS *taos, const char *sqlstr) {
...
@@ -266,8 +271,9 @@ int taos_query(TAOS *taos, const char *sqlstr) {
size_t
sqlLen
=
strlen
(
sqlstr
);
size_t
sqlLen
=
strlen
(
sqlstr
);
if
(
sqlLen
>
TSDB_MAX_SQL_LEN
)
{
if
(
sqlLen
>
TSDB_MAX_SQL_LEN
)
{
tscError
(
"%p sql too long"
,
pSql
);
pRes
->
code
=
tscInvalidSQLErrMsg
(
pSql
->
cmd
.
payload
,
"sql too long"
,
NULL
);
// set the additional error msg for invalid sql
pRes
->
code
=
TSDB_CODE_INVALID_SQL
;
tscError
(
"%p SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
taos
),
pObj
);
return
pRes
->
code
;
return
pRes
->
code
;
}
}
...
@@ -276,8 +282,9 @@ int taos_query(TAOS *taos, const char *sqlstr) {
...
@@ -276,8 +282,9 @@ int taos_query(TAOS *taos, const char *sqlstr) {
void
*
sql
=
realloc
(
pSql
->
sqlstr
,
sqlLen
+
1
);
void
*
sql
=
realloc
(
pSql
->
sqlstr
,
sqlLen
+
1
);
if
(
sql
==
NULL
)
{
if
(
sql
==
NULL
)
{
pRes
->
code
=
TSDB_CODE_CLI_OUT_OF_MEMORY
;
pRes
->
code
=
TSDB_CODE_CLI_OUT_OF_MEMORY
;
tscError
(
"%p failed to malloc sql string buffer"
,
pSql
);
tscError
(
"%p failed to malloc sql string buffer, reason:%s"
,
pSql
,
strerror
(
errno
));
tscTrace
(
"%p SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
taos
),
pObj
);
tscError
(
"%p SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
taos
),
pObj
);
return
pRes
->
code
;
return
pRes
->
code
;
}
}
...
@@ -777,9 +784,9 @@ int taos_errno(TAOS *taos) {
...
@@ -777,9 +784,9 @@ int taos_errno(TAOS *taos) {
}
}
char
*
taos_errstr
(
TAOS
*
taos
)
{
char
*
taos_errstr
(
TAOS
*
taos
)
{
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
u
nsigned
char
code
;
u
int8_t
code
;
char
temp
[
256
]
=
{
0
};
//
char temp[256] = {0};
if
(
pObj
==
NULL
||
pObj
->
signature
!=
pObj
)
return
tsError
[
globalCode
];
if
(
pObj
==
NULL
||
pObj
->
signature
!=
pObj
)
return
tsError
[
globalCode
];
...
@@ -788,9 +795,10 @@ char *taos_errstr(TAOS *taos) {
...
@@ -788,9 +795,10 @@ char *taos_errstr(TAOS *taos) {
else
else
code
=
pObj
->
pSql
->
res
.
code
;
code
=
pObj
->
pSql
->
res
.
code
;
// for invalid sql, additional information is attached to explain why the sql is invalid
if
(
code
==
TSDB_CODE_INVALID_SQL
)
{
if
(
code
==
TSDB_CODE_INVALID_SQL
)
{
snprintf
(
temp
,
tListLen
(
temp
),
"invalid SQL: %s"
,
pObj
->
pSql
->
cmd
.
payload
);
//
snprintf(temp, tListLen(temp), "invalid SQL: %s", pObj->pSql->cmd.payload);
strcpy
(
pObj
->
pSql
->
cmd
.
payload
,
temp
);
//
strcpy(pObj->pSql->cmd.payload, temp);
return
pObj
->
pSql
->
cmd
.
payload
;
return
pObj
->
pSql
->
cmd
.
payload
;
}
else
{
}
else
{
return
tsError
[
code
];
return
tsError
[
code
];
...
...
src/client/src/tscUtil.c
浏览文件 @
99c6d1ec
...
@@ -1294,8 +1294,7 @@ int32_t tscValidateName(SSQLToken* pToken) {
...
@@ -1294,8 +1294,7 @@ int32_t tscValidateName(SSQLToken* pToken) {
// re-build the whole name string
// re-build the whole name string
if
(
pStr
[
firstPartLen
]
==
TS_PATH_DELIMITER
[
0
])
{
if
(
pStr
[
firstPartLen
]
==
TS_PATH_DELIMITER
[
0
])
{
// first part do not have quote
// first part do not have quote do nothing
// do nothing
}
else
{
}
else
{
pStr
[
firstPartLen
]
=
TS_PATH_DELIMITER
[
0
];
pStr
[
firstPartLen
]
=
TS_PATH_DELIMITER
[
0
];
memmove
(
&
pStr
[
firstPartLen
+
1
],
pToken
->
z
,
pToken
->
n
);
memmove
(
&
pStr
[
firstPartLen
+
1
],
pToken
->
z
,
pToken
->
n
);
...
@@ -1842,5 +1841,30 @@ bool tscIsUpdateQuery(STscObj* pObj) {
...
@@ -1842,5 +1841,30 @@ bool tscIsUpdateQuery(STscObj* pObj) {
SSqlCmd
*
pCmd
=
&
pObj
->
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pObj
->
pSql
->
cmd
;
return
((
pCmd
->
command
>=
TSDB_SQL_INSERT
&&
pCmd
->
command
<=
TSDB_SQL_DROP_DNODE
)
||
return
((
pCmd
->
command
>=
TSDB_SQL_INSERT
&&
pCmd
->
command
<=
TSDB_SQL_DROP_DNODE
)
||
TSDB_SQL_USE_DB
==
pCmd
->
command
)
?
1
:
0
;
TSDB_SQL_USE_DB
==
pCmd
->
command
)
?
1
:
0
;
}
int32_t
tscInvalidSQLErrMsg
(
char
*
msg
,
const
char
*
additionalInfo
,
const
char
*
sql
)
{
const
char
*
msgFormat1
=
"invalid SQL: %s"
;
const
char
*
msgFormat2
=
"invalid SQL: syntax error near
\"
%s
\"
(%s)"
;
const
char
*
msgFormat3
=
"invalid SQL: syntax error near
\"
%s
\"
"
;
const
int32_t
BACKWARD_CHAR_STEP
=
0
;
if
(
sql
==
NULL
)
{
assert
(
additionalInfo
!=
NULL
);
sprintf
(
msg
,
msgFormat1
,
additionalInfo
);
return
TSDB_CODE_INVALID_SQL
;
}
char
buf
[
64
]
=
{
0
};
// only extract part of sql string
strncpy
(
buf
,
(
sql
-
BACKWARD_CHAR_STEP
),
tListLen
(
buf
)
-
1
);
if
(
additionalInfo
!=
NULL
)
{
sprintf
(
msg
,
msgFormat2
,
buf
,
additionalInfo
);
}
else
{
sprintf
(
msg
,
msgFormat3
,
buf
);
// no additional information for invalid sql error
}
return
TSDB_CODE_INVALID_SQL
;
}
}
src/connector/go/src/taosSql/utils.go
浏览文件 @
99c6d1ec
...
@@ -12,15 +12,25 @@
...
@@ -12,15 +12,25 @@
* 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/>.
*/
*/
package
taosSql
package
taosSql
/*
#cgo CFLAGS : -I/usr/include
#include <stdlib.h>
#cgo LDFLAGS: -L/usr/lib -ltaos
void taosSetAllocMode(int mode, const char* path, _Bool autoDump);
void taosDumpMemoryLeak();
*/
import
"C"
import
(
import
(
"database/sql/driver"
"database/sql/driver"
"errors"
"errors"
"fmt"
"fmt"
"sync/atomic"
"sync/atomic"
"time"
"time"
"unsafe"
)
)
// Returns the bool value of the input.
// Returns the bool value of the input.
...
@@ -398,3 +408,15 @@ func namedValueToValue(named []driver.NamedValue) ([]driver.Value, error) {
...
@@ -398,3 +408,15 @@ func namedValueToValue(named []driver.NamedValue) ([]driver.Value, error) {
}
}
/******************************************************************************
* Utils for C memory issues debugging *
******************************************************************************/
func
SetAllocMode
(
mode
int32
,
path
string
)
{
cpath
:=
C
.
CString
(
path
)
defer
C
.
free
(
unsafe
.
Pointer
(
cpath
))
C
.
taosSetAllocMode
(
C
.
int
(
mode
),
cpath
,
false
)
}
func
DumpMemoryLeak
()
{
C
.
taosDumpMemoryLeak
()
}
src/inc/sql.y
浏览文件 @
99c6d1ec
...
@@ -73,6 +73,9 @@ cmd ::= SHOW CONFIGS. { setDCLSQLElems(pInfo, SHOW_CONFIGS, 0); }
...
@@ -73,6 +73,9 @@ cmd ::= SHOW CONFIGS. { setDCLSQLElems(pInfo, SHOW_CONFIGS, 0); }
cmd ::= SHOW SCORES. { setDCLSQLElems(pInfo, SHOW_SCORES, 0); }
cmd ::= SHOW SCORES. { setDCLSQLElems(pInfo, SHOW_SCORES, 0); }
cmd ::= SHOW GRANTS. { setDCLSQLElems(pInfo, SHOW_GRANTS, 0); }
cmd ::= SHOW GRANTS. { setDCLSQLElems(pInfo, SHOW_GRANTS, 0); }
cmd ::= SHOW VNODES. { setDCLSQLElems(pInfo, SHOW_VNODES, 0); }
cmd ::= SHOW VNODES IPTOKEN(X). { setDCLSQLElems(pInfo, SHOW_VNODES, 1, &X); }
%type dbPrefix {SSQLToken}
%type dbPrefix {SSQLToken}
dbPrefix(A) ::=. {A.n = 0;}
dbPrefix(A) ::=. {A.n = 0;}
dbPrefix(A) ::= ids(X) DOT. {A = X; }
dbPrefix(A) ::= ids(X) DOT. {A = X; }
...
@@ -658,4 +661,4 @@ cmd ::= KILL QUERY IPTOKEN(X) COLON(Z) INTEGER(Y) COLON(K) INTEGER(F). {X
...
@@ -658,4 +661,4 @@ cmd ::= KILL QUERY IPTOKEN(X) COLON(Z) INTEGER(Y) COLON(K) INTEGER(F). {X
DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD
DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD
LIKE MATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL
LIKE MATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL
COUNT SUM AVG MIN MAX FIRST LAST TOP BOTTOM STDDEV PERCENTILE APERCENTILE LEASTSQUARES HISTOGRAM DIFF
COUNT SUM AVG MIN MAX FIRST LAST TOP BOTTOM STDDEV PERCENTILE APERCENTILE LEASTSQUARES HISTOGRAM DIFF
SPREAD TWA INTERP LAST_ROW NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT METRIC TBNAME JOIN METRICS STABLE NULL.
SPREAD TWA INTERP LAST_ROW NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT METRIC TBNAME JOIN METRICS STABLE NULL.
\ No newline at end of file
src/inc/taosmsg.h
浏览文件 @
99c6d1ec
...
@@ -158,6 +158,7 @@ enum _mgmt_table {
...
@@ -158,6 +158,7 @@ enum _mgmt_table {
TSDB_MGMT_TABLE_CONNS
,
TSDB_MGMT_TABLE_CONNS
,
TSDB_MGMT_TABLE_SCORES
,
TSDB_MGMT_TABLE_SCORES
,
TSDB_MGMT_TABLE_GRANTS
,
TSDB_MGMT_TABLE_GRANTS
,
TSDB_MGMT_TABLE_VNODES
,
TSDB_MGMT_TABLE_MAX
,
TSDB_MGMT_TABLE_MAX
,
};
};
...
@@ -224,7 +225,7 @@ typedef struct {
...
@@ -224,7 +225,7 @@ typedef struct {
char
meterId
[
TSDB_UNI_LEN
];
char
meterId
[
TSDB_UNI_LEN
];
uint16_t
port
;
// for UDP only
uint16_t
port
;
// for UDP only
char
empty
[
1
];
char
empty
[
1
];
char
msgType
;
uint8_t
msgType
;
int32_t
msgLen
;
int32_t
msgLen
;
uint8_t
content
[
0
];
uint8_t
content
[
0
];
}
STaosHeader
;
}
STaosHeader
;
...
@@ -567,7 +568,6 @@ typedef struct {
...
@@ -567,7 +568,6 @@ typedef struct {
typedef
struct
{
typedef
struct
{
int32_t
numOfRows
;
int32_t
numOfRows
;
int16_t
precision
;
int16_t
precision
;
int16_t
compress
;
int64_t
offset
;
// updated offset value for multi-vnode projection query
int64_t
offset
;
// updated offset value for multi-vnode projection query
int64_t
useconds
;
int64_t
useconds
;
char
data
[];
char
data
[];
...
...
src/inc/tglobalcfg.h
浏览文件 @
99c6d1ec
...
@@ -256,6 +256,8 @@ SGlobalConfig *tsGetConfigOption(const char *option);
...
@@ -256,6 +256,8 @@ SGlobalConfig *tsGetConfigOption(const char *option);
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
#define TSDB_CFG_VALUE_LEN 41
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
src/inc/tnote.h
浏览文件 @
99c6d1ec
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include "unistd.h"
#include "os.h"
#include "os.h"
#include "tutil.h"
#include "tutil.h"
#include "tglobalcfg.h"
#include "tglobalcfg.h"
...
...
src/inc/tsqldef.h
浏览文件 @
99c6d1ec
...
@@ -72,145 +72,144 @@
...
@@ -72,145 +72,144 @@
#define TK_CONFIGS 54
#define TK_CONFIGS 54
#define TK_SCORES 55
#define TK_SCORES 55
#define TK_GRANTS 56
#define TK_GRANTS 56
#define TK_DOT 57
#define TK_VNODES 57
#define TK_TABLES 58
#define TK_IPTOKEN 58
#define TK_STABLES 59
#define TK_DOT 59
#define TK_VGROUPS 60
#define TK_TABLES 60
#define TK_DROP 61
#define TK_STABLES 61
#define TK_TABLE 62
#define TK_VGROUPS 62
#define TK_DATABASE 63
#define TK_DROP 63
#define TK_DNODE 64
#define TK_TABLE 64
#define TK_IPTOKEN 65
#define TK_DATABASE 65
#define TK_USER 66
#define TK_DNODE 66
#define TK_ACCOUNT 67
#define TK_USER 67
#define TK_USE 68
#define TK_ACCOUNT 68
#define TK_DESCRIBE 69
#define TK_USE 69
#define TK_ALTER 70
#define TK_DESCRIBE 70
#define TK_PASS 71
#define TK_ALTER 71
#define TK_PRIVILEGE 72
#define TK_PASS 72
#define TK_LOCAL 73
#define TK_PRIVILEGE 73
#define TK_IF 74
#define TK_LOCAL 74
#define TK_EXISTS 75
#define TK_IF 75
#define TK_CREATE 76
#define TK_EXISTS 76
#define TK_PPS 77
#define TK_CREATE 77
#define TK_TSERIES 78
#define TK_PPS 78
#define TK_DBS 79
#define TK_TSERIES 79
#define TK_STORAGE 80
#define TK_DBS 80
#define TK_QTIME 81
#define TK_STORAGE 81
#define TK_CONNS 82
#define TK_QTIME 82
#define TK_STATE 83
#define TK_CONNS 83
#define TK_KEEP 84
#define TK_STATE 84
#define TK_CACHE 85
#define TK_KEEP 85
#define TK_REPLICA 86
#define TK_CACHE 86
#define TK_DAYS 87
#define TK_REPLICA 87
#define TK_ROWS 88
#define TK_DAYS 88
#define TK_ABLOCKS 89
#define TK_ROWS 89
#define TK_TBLOCKS 90
#define TK_ABLOCKS 90
#define TK_CTIME 91
#define TK_TBLOCKS 91
#define TK_CLOG 92
#define TK_CTIME 92
#define TK_COMP 93
#define TK_CLOG 93
#define TK_PRECISION 94
#define TK_COMP 94
#define TK_LP 95
#define TK_PRECISION 95
#define TK_RP 96
#define TK_LP 96
#define TK_TAGS 97
#define TK_RP 97
#define TK_USING 98
#define TK_TAGS 98
#define TK_AS 99
#define TK_USING 99
#define TK_COMMA 100
#define TK_AS 100
#define TK_NULL 101
#define TK_COMMA 101
#define TK_SELECT 102
#define TK_NULL 102
#define TK_FROM 103
#define TK_SELECT 103
#define TK_VARIABLE 104
#define TK_FROM 104
#define TK_INTERVAL 105
#define TK_VARIABLE 105
#define TK_FILL 106
#define TK_INTERVAL 106
#define TK_SLIDING 107
#define TK_FILL 107
#define TK_ORDER 108
#define TK_SLIDING 108
#define TK_BY 109
#define TK_ORDER 109
#define TK_ASC 110
#define TK_BY 110
#define TK_DESC 111
#define TK_ASC 111
#define TK_GROUP 112
#define TK_DESC 112
#define TK_HAVING 113
#define TK_GROUP 113
#define TK_LIMIT 114
#define TK_HAVING 114
#define TK_OFFSET 115
#define TK_LIMIT 115
#define TK_SLIMIT 116
#define TK_OFFSET 116
#define TK_SOFFSET 117
#define TK_SLIMIT 117
#define TK_WHERE 118
#define TK_SOFFSET 118
#define TK_NOW 119
#define TK_WHERE 119
#define TK_INSERT 120
#define TK_NOW 120
#define TK_INTO 121
#define TK_INSERT 121
#define TK_VALUES 122
#define TK_INTO 122
#define TK_RESET 123
#define TK_VALUES 123
#define TK_QUERY 124
#define TK_RESET 124
#define TK_ADD 125
#define TK_QUERY 125
#define TK_COLUMN 126
#define TK_ADD 126
#define TK_TAG 127
#define TK_COLUMN 127
#define TK_CHANGE 128
#define TK_TAG 128
#define TK_SET 129
#define TK_CHANGE 129
#define TK_KILL 130
#define TK_SET 130
#define TK_CONNECTION 131
#define TK_KILL 131
#define TK_COLON 132
#define TK_CONNECTION 132
#define TK_STREAM 133
#define TK_COLON 133
#define TK_ABORT 134
#define TK_STREAM 134
#define TK_AFTER 135
#define TK_ABORT 135
#define TK_ATTACH 136
#define TK_AFTER 136
#define TK_BEFORE 137
#define TK_ATTACH 137
#define TK_BEGIN 138
#define TK_BEFORE 138
#define TK_CASCADE 139
#define TK_BEGIN 139
#define TK_CLUSTER 140
#define TK_CASCADE 140
#define TK_CONFLICT 141
#define TK_CLUSTER 141
#define TK_COPY 142
#define TK_CONFLICT 142
#define TK_DEFERRED 143
#define TK_COPY 143
#define TK_DELIMITERS 144
#define TK_DEFERRED 144
#define TK_DETACH 145
#define TK_DELIMITERS 145
#define TK_EACH 146
#define TK_DETACH 146
#define TK_END 147
#define TK_EACH 147
#define TK_EXPLAIN 148
#define TK_END 148
#define TK_FAIL 149
#define TK_EXPLAIN 149
#define TK_FOR 150
#define TK_FAIL 150
#define TK_IGNORE 151
#define TK_FOR 151
#define TK_IMMEDIATE 152
#define TK_IGNORE 152
#define TK_INITIALLY 153
#define TK_IMMEDIATE 153
#define TK_INSTEAD 154
#define TK_INITIALLY 154
#define TK_MATCH 155
#define TK_INSTEAD 155
#define TK_KEY 156
#define TK_MATCH 156
#define TK_OF 157
#define TK_KEY 157
#define TK_RAISE 158
#define TK_OF 158
#define TK_REPLACE 159
#define TK_RAISE 159
#define TK_RESTRICT 160
#define TK_REPLACE 160
#define TK_ROW 161
#define TK_RESTRICT 161
#define TK_STATEMENT 162
#define TK_ROW 162
#define TK_TRIGGER 163
#define TK_STATEMENT 163
#define TK_VIEW 164
#define TK_TRIGGER 164
#define TK_ALL 165
#define TK_VIEW 165
#define TK_COUNT 166
#define TK_ALL 166
#define TK_SUM 167
#define TK_COUNT 167
#define TK_AVG 168
#define TK_SUM 168
#define TK_MIN 169
#define TK_AVG 169
#define TK_MAX 170
#define TK_MIN 170
#define TK_FIRST 171
#define TK_MAX 171
#define TK_LAST 172
#define TK_FIRST 172
#define TK_TOP 173
#define TK_LAST 173
#define TK_BOTTOM 174
#define TK_TOP 174
#define TK_STDDEV 175
#define TK_BOTTOM 175
#define TK_PERCENTILE 176
#define TK_STDDEV 176
#define TK_APERCENTILE 177
#define TK_PERCENTILE 177
#define TK_LEASTSQUARES 178
#define TK_APERCENTILE 178
#define TK_HISTOGRAM 179
#define TK_LEASTSQUARES 179
#define TK_DIFF 180
#define TK_HISTOGRAM 180
#define TK_SPREAD 181
#define TK_DIFF 181
#define TK_TWA 182
#define TK_SPREAD 182
#define TK_INTERP 183
#define TK_TWA 183
#define TK_LAST_ROW 184
#define TK_INTERP 184
#define TK_SEMI 185
#define TK_LAST_ROW 185
#define TK_NONE 186
#define TK_SEMI 186
#define TK_PREV 187
#define TK_NONE 187
#define TK_LINEAR 188
#define TK_PREV 188
#define TK_IMPORT 189
#define TK_LINEAR 189
#define TK_METRIC 190
#define TK_IMPORT 190
#define TK_TBNAME 191
#define TK_METRIC 191
#define TK_JOIN 192
#define TK_TBNAME 192
#define TK_METRICS 193
#define TK_JOIN 193
#define TK_STABLE 194
#define TK_METRICS 194
#define TK_STABLE 195
#endif
#endif
src/inc/tutil.h
浏览文件 @
99c6d1ec
...
@@ -187,18 +187,35 @@ static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, unsigned int inLen, cha
...
@@ -187,18 +187,35 @@ static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, unsigned int inLen, cha
char
*
taosIpStr
(
uint32_t
ipInt
);
char
*
taosIpStr
(
uint32_t
ipInt
);
#ifdef _TAOS_MEM_TEST_
#define TAOS_ALLOC_MODE_DEFAULT 0
// Use during test to simulate the success and failure scenarios of memory allocation
#define TAOS_ALLOC_MODE_RANDOM_FAIL 1
extern
void
*
taos_malloc
(
unsigned
int
size
,
char
*
_func
);
#define TAOS_ALLOC_MODE_DETECT_LEAK 2
extern
void
*
taos_calloc
(
unsigned
int
num
,
unsigned
int
size
,
char
*
_func
);
void
taosSetAllocMode
(
int
mode
,
const
char
*
path
,
bool
autoDump
);
extern
void
*
taos_realloc
(
void
*
ptr
,
unsigned
int
size
,
char
*
_func
);
void
taosDumpMemoryLeak
();
extern
void
taos_free
(
void
*
ptr
);
#define malloc(size) taos_malloc(size, __FUNCTION__)
#ifdef TAOS_MEM_CHECK
#define calloc(num, size) taos_calloc(num, size, __FUNCTION__)
#define realloc(ptr, size) taos_realloc(ptr, size, __FUNCTION__)
void
*
taos_malloc
(
size_t
size
,
const
char
*
file
,
uint32_t
line
);
#define free(ptr) taos_free(ptr)
void
*
taos_calloc
(
size_t
num
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
#endif
void
*
taos_realloc
(
void
*
ptr
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
taos_free
(
void
*
ptr
,
const
char
*
file
,
uint32_t
line
);
char
*
taos_strdup
(
const
char
*
str
,
const
char
*
file
,
uint32_t
line
);
char
*
taos_strndup
(
const
char
*
str
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
ssize_t
taos_getline
(
char
**
lineptr
,
size_t
*
n
,
FILE
*
stream
,
const
char
*
file
,
uint32_t
line
);
#ifndef TAOS_MEM_CHECK_IMPL
#define malloc(size) taos_malloc(size, __FILE__, __LINE__)
#define calloc(num, size) taos_calloc(num, size, __FILE__, __LINE__)
#define realloc(ptr, size) taos_realloc(ptr, size, __FILE__, __LINE__)
#define free(ptr) taos_free(ptr, __FILE__, __LINE__)
#define strdup(str) taos_strdup(str, __FILE__, __LINE__)
#define strndup(str, size) taos_strndup(str, size, __FILE__, __LINE__)
#define getline(lineptr, n, stream) taos_getline(lineptr, n, stream, __FILE__, __LINE__)
#endif // TAOS_MEM_CHECK_IMPL
#endif // TAOS_MEM_CHECK
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/os/linux/src/tsystem.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/os/windows/inc/os.h
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/os/windows/src/twindows.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/rpc/src/trpc.c
100644 → 100755
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/sdb/src/sdbEngine.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/inc/mgmt.h
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/inc/vnode.h
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/dnodeService.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/mgmtDnode.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/mgmtMeter.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/mgmtShell.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/vnodeFile.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/vnodeRead.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/system/detail/src/vnodeShell.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/util/CMakeLists.txt
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/util/src/tglobalcfg.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/util/src/tmem.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/util/src/ttokenizer.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
src/util/src/version.c
浏览文件 @
99c6d1ec
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录