Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2ba34f5e
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看板
未验证
提交
2ba34f5e
编写于
5月 15, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
5月 15, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6123 from ExplorerBellBox/develop
fix some type errors, and reduce potential errors
上级
af7a668b
d33e0f59
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
121 addition
and
113 deletion
+121
-113
.gitignore
.gitignore
+1
-0
CMakeLists.txt
CMakeLists.txt
+8
-1
packaging/release.sh
packaging/release.sh
+2
-2
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+2
-2
src/connector/odbc/examples/c/main.c
src/connector/odbc/examples/c/main.c
+3
-3
src/connector/odbc/src/base/tsdb_impl.c
src/connector/odbc/src/base/tsdb_impl.c
+2
-2
src/kit/shell/src/shellCheck.c
src/kit/shell/src/shellCheck.c
+12
-12
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+21
-21
src/kit/shell/src/shellImport.c
src/kit/shell/src/shellImport.c
+11
-11
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+1
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+3
-3
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+1
-1
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+3
-3
src/plugins/http/src/httpGzip.c
src/plugins/http/src/httpGzip.c
+2
-2
src/plugins/http/src/httpParser.c
src/plugins/http/src/httpParser.c
+3
-3
src/plugins/http/src/httpTgHandle.c
src/plugins/http/src/httpTgHandle.c
+1
-1
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+1
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+7
-7
src/sync/src/syncMsg.c
src/sync/src/syncMsg.c
+2
-2
src/tsdb/inc/tsdbMeta.h
src/tsdb/inc/tsdbMeta.h
+4
-4
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+3
-3
src/tsdb/src/tsdbFS.c
src/tsdb/src/tsdbFS.c
+6
-6
src/tsdb/src/tsdbFile.c
src/tsdb/src/tsdbFile.c
+5
-5
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+5
-5
src/util/src/tdes.c
src/util/src/tdes.c
+7
-7
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+1
-1
tests/comparisonTest/tdengine/tdengineTest.c
tests/comparisonTest/tdengine/tdengineTest.c
+4
-4
未找到文件。
.gitignore
浏览文件 @
2ba34f5e
...
@@ -2,6 +2,7 @@ build/
...
@@ -2,6 +2,7 @@ build/
.vscode/
.vscode/
.idea/
.idea/
cmake-build-debug/
cmake-build-debug/
cmake-build-release/
cscope.out
cscope.out
.DS_Store
.DS_Store
debug/
debug/
...
...
CMakeLists.txt
浏览文件 @
2ba34f5e
...
@@ -3,7 +3,7 @@ IF (CMAKE_VERSION VERSION_LESS 3.0)
...
@@ -3,7 +3,7 @@ IF (CMAKE_VERSION VERSION_LESS 3.0)
PROJECT
(
TDengine CXX
)
PROJECT
(
TDengine CXX
)
SET
(
PROJECT_VERSION_MAJOR
"
${
LIB_MAJOR_VERSION
}
"
)
SET
(
PROJECT_VERSION_MAJOR
"
${
LIB_MAJOR_VERSION
}
"
)
SET
(
PROJECT_VERSION_MINOR
"
${
LIB_MINOR_VERSION
}
"
)
SET
(
PROJECT_VERSION_MINOR
"
${
LIB_MINOR_VERSION
}
"
)
SET
(
PROJECT_VERSION_PATCH
"
${
LIB_PATCH_VERSION
}
"
)
SET
(
PROJECT_VERSION_PATCH
"
${
LIB_PATCH_VERSION
}
"
)
SET
(
PROJECT_VERSION
"
${
LIB_VERSION_STRING
}
"
)
SET
(
PROJECT_VERSION
"
${
LIB_VERSION_STRING
}
"
)
ELSE
()
ELSE
()
CMAKE_POLICY
(
SET CMP0048 NEW
)
CMAKE_POLICY
(
SET CMP0048 NEW
)
...
@@ -42,6 +42,13 @@ INCLUDE(cmake/env.inc)
...
@@ -42,6 +42,13 @@ INCLUDE(cmake/env.inc)
INCLUDE
(
cmake/version.inc
)
INCLUDE
(
cmake/version.inc
)
INCLUDE
(
cmake/install.inc
)
INCLUDE
(
cmake/install.inc
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"Linux"
)
SET
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-pipe -Wall -Wshadow -Werror"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-pipe -Wall -Wshadow -Werror"
)
ENDIF
()
MESSAGE
(
STATUS
"CMAKE_C_FLAGS:
${
CMAKE_C_FLAGS
}
"
)
MESSAGE
(
STATUS
"CMAKE_CXX_FLAGS:
${
CMAKE_CXX_FLAGS
}
"
)
ADD_SUBDIRECTORY
(
deps
)
ADD_SUBDIRECTORY
(
deps
)
ADD_SUBDIRECTORY
(
src
)
ADD_SUBDIRECTORY
(
src
)
ADD_SUBDIRECTORY
(
tests
)
ADD_SUBDIRECTORY
(
tests
)
...
...
packaging/release.sh
浏览文件 @
2ba34f5e
#!/bin/bash
#!/bin/bash
#
#
# Generate the deb package for ubunt, or rpm package for centos, or tar.gz package for other linux os
# Generate the deb package for ubunt
u
, or rpm package for centos, or tar.gz package for other linux os
set
-e
set
-e
#set -x
#set -x
# releas
h.sh -v [cluster | edge]
# releas
e.sh -v [cluster | edge]
# -c [aarch32 | aarch64 | x64 | x86 | mips64 ...]
# -c [aarch32 | aarch64 | x64 | x86 | mips64 ...]
# -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
# -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...]
# -V [stable | beta]
# -V [stable | beta]
...
...
src/client/src/tscSubquery.c
浏览文件 @
2ba34f5e
...
@@ -55,9 +55,9 @@ static void skipRemainValue(STSBuf* pTSBuf, tVariant* tag1) {
...
@@ -55,9 +55,9 @@ static void skipRemainValue(STSBuf* pTSBuf, tVariant* tag1) {
}
}
while
(
tsBufNextPos
(
pTSBuf
))
{
while
(
tsBufNextPos
(
pTSBuf
))
{
STSElem
el1
=
tsBufGetElem
(
pTSBuf
);
el1
=
tsBufGetElem
(
pTSBuf
);
int32_t
res
=
tVariantCompare
(
el1
.
tag
,
tag1
);
res
=
tVariantCompare
(
el1
.
tag
,
tag1
);
if
(
res
!=
0
)
{
// it is a record with new tag
if
(
res
!=
0
)
{
// it is a record with new tag
return
;
return
;
}
}
...
...
src/connector/odbc/examples/c/main.c
浏览文件 @
2ba34f5e
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
#define CHK_TEST(statement) \
#define CHK_TEST(statement) \
do { \
do { \
D("testing: %s", #statement); \
D("testing: %s", #statement); \
int r = (statement); \
int
_
r = (statement); \
if (r) { \
if (
_
r) { \
D("testing failed: %s", #statement); \
D("testing failed: %s", #statement); \
return 1; \
return 1; \
} \
} \
...
@@ -181,7 +181,7 @@ static int do_statement(SQLHSTMT stmt, const char *statement) {
...
@@ -181,7 +181,7 @@ static int do_statement(SQLHSTMT stmt, const char *statement) {
r
=
traverse_cols
(
stmt
,
cols
);
r
=
traverse_cols
(
stmt
,
cols
);
char
buf
[
4096
];
char
buf
[
4096
];
while
(
1
)
{
while
(
1
)
{
SQLRETURN
r
=
SQLFetch
(
stmt
);
r
=
SQLFetch
(
stmt
);
if
(
r
==
SQL_NO_DATA
)
break
;
if
(
r
==
SQL_NO_DATA
)
break
;
CHK_RESULT
(
r
,
SQL_HANDLE_STMT
,
stmt
,
""
);
CHK_RESULT
(
r
,
SQL_HANDLE_STMT
,
stmt
,
""
);
for
(
size_t
i
=
0
;
i
<
cols
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
cols
;
++
i
)
{
...
...
src/connector/odbc/src/base/tsdb_impl.c
浏览文件 @
2ba34f5e
...
@@ -1762,8 +1762,8 @@ static SQLRETURN tsdb_conn_prepare(stmt_t *stmt) {
...
@@ -1762,8 +1762,8 @@ static SQLRETURN tsdb_conn_prepare(stmt_t *stmt) {
tsdb_stmt
->
tsdb_params
=
tsdb_params
;
tsdb_stmt
->
tsdb_params
=
tsdb_params
;
for
(
int
i
=
0
;
i
<
nums
;
++
i
)
{
for
(
int
i
=
0
;
i
<
nums
;
++
i
)
{
SQLRETURN
r
=
do_fill_param
(
stmt
,
i
);
SQLRETURN
_
r
=
do_fill_param
(
stmt
,
i
);
if
(
r
)
return
r
;
if
(
_r
)
return
_
r
;
}
}
}
}
...
...
src/kit/shell/src/shellCheck.c
浏览文件 @
2ba34f5e
...
@@ -148,15 +148,15 @@ static void *shellCheckThreadFp(void *arg) {
...
@@ -148,15 +148,15 @@ static void *shellCheckThreadFp(void *arg) {
return
NULL
;
return
NULL
;
}
}
static
void
shellRunCheckThreads
(
TAOS
*
con
,
SShellArguments
*
args
)
{
static
void
shellRunCheckThreads
(
TAOS
*
con
,
SShellArguments
*
_
args
)
{
pthread_attr_t
thattr
;
pthread_attr_t
thattr
;
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
_
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
ShellThreadObj
*
pThread
=
threadObj
+
t
;
ShellThreadObj
*
pThread
=
threadObj
+
t
;
pThread
->
threadIndex
=
t
;
pThread
->
threadIndex
=
t
;
pThread
->
totalThreads
=
args
->
threadNum
;
pThread
->
totalThreads
=
_
args
->
threadNum
;
pThread
->
taos
=
con
;
pThread
->
taos
=
con
;
pThread
->
db
=
args
->
database
;
pThread
->
db
=
_
args
->
database
;
pthread_attr_init
(
&
thattr
);
pthread_attr_init
(
&
thattr
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
...
@@ -167,31 +167,31 @@ static void shellRunCheckThreads(TAOS *con, SShellArguments *args) {
...
@@ -167,31 +167,31 @@ static void shellRunCheckThreads(TAOS *con, SShellArguments *args) {
}
}
}
}
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
pthread_join
(
threadObj
[
t
].
threadID
,
NULL
);
pthread_join
(
threadObj
[
t
].
threadID
,
NULL
);
}
}
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
taos_close
(
threadObj
[
t
].
taos
);
taos_close
(
threadObj
[
t
].
taos
);
}
}
free
(
threadObj
);
free
(
threadObj
);
}
}
void
shellCheck
(
TAOS
*
con
,
SShellArguments
*
args
)
{
void
shellCheck
(
TAOS
*
con
,
SShellArguments
*
_
args
)
{
int64_t
start
=
taosGetTimestampMs
();
int64_t
start
=
taosGetTimestampMs
();
if
(
shellUseDb
(
con
,
args
->
database
)
!=
0
)
{
if
(
shellUseDb
(
con
,
_
args
->
database
)
!=
0
)
{
shellFreeTbnames
();
shellFreeTbnames
();
return
;
return
;
}
}
if
(
shellShowTables
(
con
,
args
->
database
)
!=
0
)
{
if
(
shellShowTables
(
con
,
_
args
->
database
)
!=
0
)
{
shellFreeTbnames
();
shellFreeTbnames
();
return
;
return
;
}
}
fprintf
(
stdout
,
"total %d tables will be checked by %d threads
\n
"
,
tbNum
,
args
->
threadNum
);
fprintf
(
stdout
,
"total %d tables will be checked by %d threads
\n
"
,
tbNum
,
_
args
->
threadNum
);
shellRunCheckThreads
(
con
,
args
);
shellRunCheckThreads
(
con
,
_
args
);
int64_t
end
=
taosGetTimestampMs
();
int64_t
end
=
taosGetTimestampMs
();
fprintf
(
stdout
,
"total %d tables checked, failed:%d, time spent %.2f seconds
\n
"
,
checkedNum
,
errorNum
,
fprintf
(
stdout
,
"total %d tables checked, failed:%d, time spent %.2f seconds
\n
"
,
checkedNum
,
errorNum
,
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
2ba34f5e
...
@@ -56,24 +56,24 @@ extern TAOS *taos_connect_auth(const char *ip, const char *user, const char *aut
...
@@ -56,24 +56,24 @@ extern TAOS *taos_connect_auth(const char *ip, const char *user, const char *aut
/*
/*
* FUNCTION: Initialize the shell.
* FUNCTION: Initialize the shell.
*/
*/
TAOS
*
shellInit
(
SShellArguments
*
args
)
{
TAOS
*
shellInit
(
SShellArguments
*
_
args
)
{
printf
(
"
\n
"
);
printf
(
"
\n
"
);
printf
(
CLIENT_VERSION
,
tsOsName
,
taos_get_client_info
());
printf
(
CLIENT_VERSION
,
tsOsName
,
taos_get_client_info
());
fflush
(
stdout
);
fflush
(
stdout
);
// set options before initializing
// set options before initializing
if
(
args
->
timezone
!=
NULL
)
{
if
(
_
args
->
timezone
!=
NULL
)
{
taos_options
(
TSDB_OPTION_TIMEZONE
,
args
->
timezone
);
taos_options
(
TSDB_OPTION_TIMEZONE
,
_
args
->
timezone
);
}
}
if
(
args
->
is_use_passwd
)
{
if
(
_
args
->
is_use_passwd
)
{
if
(
args
->
password
==
NULL
)
args
->
password
=
getpass
(
"Enter password: "
);
if
(
_args
->
password
==
NULL
)
_
args
->
password
=
getpass
(
"Enter password: "
);
}
else
{
}
else
{
args
->
password
=
TSDB_DEFAULT_PASS
;
_
args
->
password
=
TSDB_DEFAULT_PASS
;
}
}
if
(
args
->
user
==
NULL
)
{
if
(
_
args
->
user
==
NULL
)
{
args
->
user
=
TSDB_DEFAULT_USER
;
_
args
->
user
=
TSDB_DEFAULT_USER
;
}
}
if
(
taos_init
())
{
if
(
taos_init
())
{
...
@@ -84,10 +84,10 @@ TAOS *shellInit(SShellArguments *args) {
...
@@ -84,10 +84,10 @@ TAOS *shellInit(SShellArguments *args) {
// Connect to the database.
// Connect to the database.
TAOS
*
con
=
NULL
;
TAOS
*
con
=
NULL
;
if
(
args
->
auth
==
NULL
)
{
if
(
_
args
->
auth
==
NULL
)
{
con
=
taos_connect
(
args
->
host
,
args
->
user
,
args
->
password
,
args
->
database
,
args
->
port
);
con
=
taos_connect
(
_args
->
host
,
_args
->
user
,
_args
->
password
,
_args
->
database
,
_
args
->
port
);
}
else
{
}
else
{
con
=
taos_connect_auth
(
args
->
host
,
args
->
user
,
args
->
auth
,
args
->
database
,
args
->
port
);
con
=
taos_connect_auth
(
_args
->
host
,
_args
->
user
,
_args
->
auth
,
_args
->
database
,
_
args
->
port
);
}
}
if
(
con
==
NULL
)
{
if
(
con
==
NULL
)
{
...
@@ -100,14 +100,14 @@ TAOS *shellInit(SShellArguments *args) {
...
@@ -100,14 +100,14 @@ TAOS *shellInit(SShellArguments *args) {
read_history
();
read_history
();
// Check if it is temperory run
// Check if it is temperory run
if
(
args
->
commands
!=
NULL
||
args
->
file
[
0
]
!=
0
)
{
if
(
_args
->
commands
!=
NULL
||
_
args
->
file
[
0
]
!=
0
)
{
if
(
args
->
commands
!=
NULL
)
{
if
(
_
args
->
commands
!=
NULL
)
{
printf
(
"%s%s
\n
"
,
PROMPT_HEADER
,
args
->
commands
);
printf
(
"%s%s
\n
"
,
PROMPT_HEADER
,
_
args
->
commands
);
shellRunCommand
(
con
,
args
->
commands
);
shellRunCommand
(
con
,
_
args
->
commands
);
}
}
if
(
args
->
file
[
0
]
!=
0
)
{
if
(
_
args
->
file
[
0
]
!=
0
)
{
source_file
(
con
,
args
->
file
);
source_file
(
con
,
_
args
->
file
);
}
}
taos_close
(
con
);
taos_close
(
con
);
...
@@ -116,14 +116,14 @@ TAOS *shellInit(SShellArguments *args) {
...
@@ -116,14 +116,14 @@ TAOS *shellInit(SShellArguments *args) {
}
}
#ifndef WINDOWS
#ifndef WINDOWS
if
(
args
->
dir
[
0
]
!=
0
)
{
if
(
_
args
->
dir
[
0
]
!=
0
)
{
source_dir
(
con
,
args
);
source_dir
(
con
,
_
args
);
taos_close
(
con
);
taos_close
(
con
);
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
}
}
if
(
args
->
check
!=
0
)
{
if
(
_
args
->
check
!=
0
)
{
shellCheck
(
con
,
args
);
shellCheck
(
con
,
_
args
);
taos_close
(
con
);
taos_close
(
con
);
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
}
}
...
...
src/kit/shell/src/shellImport.c
浏览文件 @
2ba34f5e
...
@@ -233,15 +233,15 @@ void* shellImportThreadFp(void *arg)
...
@@ -233,15 +233,15 @@ void* shellImportThreadFp(void *arg)
return
NULL
;
return
NULL
;
}
}
static
void
shellRunImportThreads
(
SShellArguments
*
args
)
static
void
shellRunImportThreads
(
SShellArguments
*
_
args
)
{
{
pthread_attr_t
thattr
;
pthread_attr_t
thattr
;
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
_
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
ShellThreadObj
*
pThread
=
threadObj
+
t
;
ShellThreadObj
*
pThread
=
threadObj
+
t
;
pThread
->
threadIndex
=
t
;
pThread
->
threadIndex
=
t
;
pThread
->
totalThreads
=
args
->
threadNum
;
pThread
->
totalThreads
=
_
args
->
threadNum
;
pThread
->
taos
=
taos_connect
(
args
->
host
,
args
->
user
,
args
->
password
,
args
->
database
,
tsDnodeShellPort
);
pThread
->
taos
=
taos_connect
(
_args
->
host
,
_args
->
user
,
_args
->
password
,
_
args
->
database
,
tsDnodeShellPort
);
if
(
pThread
->
taos
==
NULL
)
{
if
(
pThread
->
taos
==
NULL
)
{
fprintf
(
stderr
,
"ERROR: thread:%d failed connect to TDengine, error:%s
\n
"
,
pThread
->
threadIndex
,
"null taos"
/*taos_errstr(pThread->taos)*/
);
fprintf
(
stderr
,
"ERROR: thread:%d failed connect to TDengine, error:%s
\n
"
,
pThread
->
threadIndex
,
"null taos"
/*taos_errstr(pThread->taos)*/
);
exit
(
0
);
exit
(
0
);
...
@@ -256,18 +256,18 @@ static void shellRunImportThreads(SShellArguments* args)
...
@@ -256,18 +256,18 @@ static void shellRunImportThreads(SShellArguments* args)
}
}
}
}
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
pthread_join
(
threadObj
[
t
].
threadID
,
NULL
);
pthread_join
(
threadObj
[
t
].
threadID
,
NULL
);
}
}
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
taos_close
(
threadObj
[
t
].
taos
);
taos_close
(
threadObj
[
t
].
taos
);
}
}
free
(
threadObj
);
free
(
threadObj
);
}
}
void
source_dir
(
TAOS
*
con
,
SShellArguments
*
args
)
{
void
source_dir
(
TAOS
*
con
,
SShellArguments
*
_
args
)
{
shellGetDirectoryFileList
(
args
->
dir
);
shellGetDirectoryFileList
(
_
args
->
dir
);
int64_t
start
=
taosGetTimestampMs
();
int64_t
start
=
taosGetTimestampMs
();
if
(
shellTablesSQLFile
[
0
]
!=
0
)
{
if
(
shellTablesSQLFile
[
0
]
!=
0
)
{
...
@@ -276,7 +276,7 @@ void source_dir(TAOS* con, SShellArguments* args) {
...
@@ -276,7 +276,7 @@ void source_dir(TAOS* con, SShellArguments* args) {
fprintf
(
stdout
,
"import %s finished, time spent %.2f seconds
\n
"
,
shellTablesSQLFile
,
(
end
-
start
)
/
1000
.
0
);
fprintf
(
stdout
,
"import %s finished, time spent %.2f seconds
\n
"
,
shellTablesSQLFile
,
(
end
-
start
)
/
1000
.
0
);
}
}
shellRunImportThreads
(
args
);
shellRunImportThreads
(
_
args
);
int64_t
end
=
taosGetTimestampMs
();
int64_t
end
=
taosGetTimestampMs
();
fprintf
(
stdout
,
"import %s finished, time spent %.2f seconds
\n
"
,
args
->
dir
,
(
end
-
start
)
/
1000
.
0
);
fprintf
(
stdout
,
"import %s finished, time spent %.2f seconds
\n
"
,
_
args
->
dir
,
(
end
-
start
)
/
1000
.
0
);
}
}
src/kit/shell/src/shellLinux.c
浏览文件 @
2ba34f5e
...
@@ -415,7 +415,7 @@ void set_terminal_mode() {
...
@@ -415,7 +415,7 @@ void set_terminal_mode() {
}
}
}
}
void
get_history_path
(
char
*
history
)
{
snprintf
(
history
,
TSDB_FILENAME_LEN
,
"%s/%s"
,
getenv
(
"HOME"
),
HISTORY_FILE
);
}
void
get_history_path
(
char
*
_history
)
{
snprintf
(
_
history
,
TSDB_FILENAME_LEN
,
"%s/%s"
,
getenv
(
"HOME"
),
HISTORY_FILE
);
}
void
clearScreen
(
int
ecmd_pos
,
int
cursor_pos
)
{
void
clearScreen
(
int
ecmd_pos
,
int
cursor_pos
)
{
struct
winsize
w
;
struct
winsize
w
;
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
2ba34f5e
...
@@ -3884,7 +3884,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3884,7 +3884,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
cJSON
*
maxSqlLen
=
cJSON_GetObjectItem
(
stbInfo
,
"max_sql_len"
);
maxSqlLen
=
cJSON_GetObjectItem
(
stbInfo
,
"max_sql_len"
);
if
(
maxSqlLen
&&
maxSqlLen
->
type
==
cJSON_Number
)
{
if
(
maxSqlLen
&&
maxSqlLen
->
type
==
cJSON_Number
)
{
int32_t
len
=
maxSqlLen
->
valueint
;
int32_t
len
=
maxSqlLen
->
valueint
;
if
(
len
>
TSDB_MAX_ALLOWED_SQL_LEN
)
{
if
(
len
>
TSDB_MAX_ALLOWED_SQL_LEN
)
{
...
@@ -3918,7 +3918,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3918,7 +3918,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto PARSE_OVER;
goto PARSE_OVER;
}
}
*/
*/
cJSON
*
interlaceRows
=
cJSON_GetObjectItem
(
stbInfo
,
"interlace_rows"
);
interlaceRows
=
cJSON_GetObjectItem
(
stbInfo
,
"interlace_rows"
);
if
(
interlaceRows
&&
interlaceRows
->
type
==
cJSON_Number
)
{
if
(
interlaceRows
&&
interlaceRows
->
type
==
cJSON_Number
)
{
if
(
interlaceRows
->
valueint
<
0
)
{
if
(
interlaceRows
->
valueint
<
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, interlace rows input mistake
\n
"
,
errorPrint
(
"%s() LN%d, failed to read json, interlace rows input mistake
\n
"
,
...
@@ -4661,7 +4661,7 @@ static int64_t generateData(char *recBuf, char **data_type,
...
@@ -4661,7 +4661,7 @@ static int64_t generateData(char *recBuf, char **data_type,
double
t
=
rand_double
();
double
t
=
rand_double
();
pstr
+=
sprintf
(
pstr
,
",%20.8f"
,
t
);
pstr
+=
sprintf
(
pstr
,
",%20.8f"
,
t
);
}
else
if
(
strcasecmp
(
data_type
[
i
%
c
],
"BOOL"
)
==
0
)
{
}
else
if
(
strcasecmp
(
data_type
[
i
%
c
],
"BOOL"
)
==
0
)
{
bool
b
=
rand_bool
()
&
1
;
bool
b
=
taosRandom
()
&
1
;
pstr
+=
sprintf
(
pstr
,
",%s"
,
b
?
"true"
:
"false"
);
pstr
+=
sprintf
(
pstr
,
",%s"
,
b
?
"true"
:
"false"
);
}
else
if
(
strcasecmp
(
data_type
[
i
%
c
],
"BINARY"
)
==
0
)
{
}
else
if
(
strcasecmp
(
data_type
[
i
%
c
],
"BINARY"
)
==
0
)
{
char
*
s
=
malloc
(
lenOfBinary
);
char
*
s
=
malloc
(
lenOfBinary
);
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
2ba34f5e
...
@@ -1017,7 +1017,7 @@ int taosDumpOut(struct arguments *arguments) {
...
@@ -1017,7 +1017,7 @@ int taosDumpOut(struct arguments *arguments) {
sprintf
(
command
,
"use %s"
,
dbInfos
[
0
]
->
name
);
sprintf
(
command
,
"use %s"
,
dbInfos
[
0
]
->
name
);
result
=
taos_query
(
taos
,
command
);
result
=
taos_query
(
taos
,
command
);
int32_t
code
=
taos_errno
(
result
);
code
=
taos_errno
(
result
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
fprintf
(
stderr
,
"invalid database %s
\n
"
,
dbInfos
[
0
]
->
name
);
fprintf
(
stderr
,
"invalid database %s
\n
"
,
dbInfos
[
0
]
->
name
);
goto
_exit_failure
;
goto
_exit_failure
;
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
2ba34f5e
...
@@ -522,13 +522,13 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -522,13 +522,13 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
pStatus
->
lastReboot
=
htonl
(
pStatus
->
lastReboot
);
pStatus
->
lastReboot
=
htonl
(
pStatus
->
lastReboot
);
pStatus
->
numOfCores
=
htons
(
pStatus
->
numOfCores
);
pStatus
->
numOfCores
=
htons
(
pStatus
->
numOfCores
);
uint32_t
version
=
htonl
(
pStatus
->
version
);
uint32_t
_
version
=
htonl
(
pStatus
->
version
);
if
(
version
!=
tsVersion
)
{
if
(
_
version
!=
tsVersion
)
{
pDnode
=
mnodeGetDnodeByEp
(
pStatus
->
dnodeEp
);
pDnode
=
mnodeGetDnodeByEp
(
pStatus
->
dnodeEp
);
if
(
pDnode
!=
NULL
&&
pDnode
->
status
!=
TAOS_DN_STATUS_READY
)
{
if
(
pDnode
!=
NULL
&&
pDnode
->
status
!=
TAOS_DN_STATUS_READY
)
{
pDnode
->
offlineReason
=
TAOS_DN_OFF_VERSION_NOT_MATCH
;
pDnode
->
offlineReason
=
TAOS_DN_OFF_VERSION_NOT_MATCH
;
}
}
mError
(
"dnode:%d, status msg version:%d not equal with cluster:%d"
,
pStatus
->
dnodeId
,
version
,
tsVersion
);
mError
(
"dnode:%d, status msg version:%d not equal with cluster:%d"
,
pStatus
->
dnodeId
,
_
version
,
tsVersion
);
return
TSDB_CODE_MND_INVALID_MSG_VERSION
;
return
TSDB_CODE_MND_INVALID_MSG_VERSION
;
}
}
...
...
src/plugins/http/src/httpGzip.c
浏览文件 @
2ba34f5e
...
@@ -132,10 +132,10 @@ int32_t ehttp_gzip_write(ehttp_gzip_t *gzip, const char *buf, int32_t len) {
...
@@ -132,10 +132,10 @@ int32_t ehttp_gzip_write(ehttp_gzip_t *gzip, const char *buf, int32_t len) {
if
(
ret
!=
Z_STREAM_END
)
continue
;
if
(
ret
!=
Z_STREAM_END
)
continue
;
}
}
int32_t
len
=
(
int32_t
)(
gzip
->
gzip
->
next_out
-
(
z_const
Bytef
*
)
gzip
->
chunk
);
int32_t
_
len
=
(
int32_t
)(
gzip
->
gzip
->
next_out
-
(
z_const
Bytef
*
)
gzip
->
chunk
);
gzip
->
gzip
->
next_out
[
0
]
=
'\0'
;
gzip
->
gzip
->
next_out
[
0
]
=
'\0'
;
gzip
->
callbacks
.
on_data
(
gzip
,
gzip
->
arg
,
gzip
->
chunk
,
len
);
gzip
->
callbacks
.
on_data
(
gzip
,
gzip
->
arg
,
gzip
->
chunk
,
_
len
);
gzip
->
gzip
->
next_out
=
(
z_const
Bytef
*
)
gzip
->
chunk
;
gzip
->
gzip
->
next_out
=
(
z_const
Bytef
*
)
gzip
->
chunk
;
gzip
->
gzip
->
avail_out
=
gzip
->
conf
.
chunk_size
;
gzip
->
gzip
->
avail_out
=
gzip
->
conf
.
chunk_size
;
}
}
...
...
src/plugins/http/src/httpParser.c
浏览文件 @
2ba34f5e
...
@@ -163,9 +163,9 @@ static int32_t httpOnRequestLine(HttpParser *pParser, char *method, char *target
...
@@ -163,9 +163,9 @@ static int32_t httpOnRequestLine(HttpParser *pParser, char *method, char *target
// parse decode method
// parse decode method
for
(
int32_t
i
=
0
;
i
<
tsHttpServer
.
methodScannerLen
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
tsHttpServer
.
methodScannerLen
;
i
++
)
{
HttpDecodeMethod
*
method
=
tsHttpServer
.
methodScanner
[
i
];
HttpDecodeMethod
*
_
method
=
tsHttpServer
.
methodScanner
[
i
];
if
(
strcmp
(
method
->
module
,
pParser
->
path
[
0
].
str
)
==
0
)
{
if
(
strcmp
(
_
method
->
module
,
pParser
->
path
[
0
].
str
)
==
0
)
{
pContext
->
decodeMethod
=
method
;
pContext
->
decodeMethod
=
_
method
;
break
;
break
;
}
}
}
}
...
...
src/plugins/http/src/httpTgHandle.c
浏览文件 @
2ba34f5e
...
@@ -209,7 +209,7 @@ void tgParseSchemaMetric(cJSON *metric) {
...
@@ -209,7 +209,7 @@ void tgParseSchemaMetric(cJSON *metric) {
parsedOk
=
false
;
parsedOk
=
false
;
goto
ParseEnd
;
goto
ParseEnd
;
}
}
int32_t
nameLen
=
(
int32_t
)
strlen
(
field
->
valuestring
);
nameLen
=
(
int32_t
)
strlen
(
field
->
valuestring
);
if
(
nameLen
==
0
||
nameLen
>=
TSDB_TABLE_NAME_LEN
)
{
if
(
nameLen
==
0
||
nameLen
>=
TSDB_TABLE_NAME_LEN
)
{
parsedOk
=
false
;
parsedOk
=
false
;
goto
ParseEnd
;
goto
ParseEnd
;
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
2ba34f5e
...
@@ -576,7 +576,7 @@ static void *taosProcessTcpData(void *param) {
...
@@ -576,7 +576,7 @@ static void *taosProcessTcpData(void *param) {
}
}
while
(
pThreadObj
->
pHead
)
{
while
(
pThreadObj
->
pHead
)
{
SFdObj
*
pFdObj
=
pThreadObj
->
pHead
;
pFdObj
=
pThreadObj
->
pHead
;
pThreadObj
->
pHead
=
pFdObj
->
next
;
pThreadObj
->
pHead
=
pFdObj
->
next
;
taosReportBrokenLink
(
pFdObj
);
taosReportBrokenLink
(
pFdObj
);
}
}
...
...
src/sync/src/syncMain.c
浏览文件 @
2ba34f5e
...
@@ -389,17 +389,17 @@ int32_t syncForwardToPeer(int64_t rid, void *data, void *mhandle, int32_t qtype,
...
@@ -389,17 +389,17 @@ int32_t syncForwardToPeer(int64_t rid, void *data, void *mhandle, int32_t qtype,
return
code
;
return
code
;
}
}
void
syncConfirmForward
(
int64_t
rid
,
uint64_t
version
,
int32_t
code
,
bool
force
)
{
void
syncConfirmForward
(
int64_t
rid
,
uint64_t
_
version
,
int32_t
code
,
bool
force
)
{
SSyncNode
*
pNode
=
syncAcquireNode
(
rid
);
SSyncNode
*
pNode
=
syncAcquireNode
(
rid
);
if
(
pNode
==
NULL
)
return
;
if
(
pNode
==
NULL
)
return
;
SSyncPeer
*
pPeer
=
pNode
->
pMaster
;
SSyncPeer
*
pPeer
=
pNode
->
pMaster
;
if
(
pPeer
&&
(
pNode
->
quorum
>
1
||
force
))
{
if
(
pPeer
&&
(
pNode
->
quorum
>
1
||
force
))
{
SFwdRsp
rsp
;
SFwdRsp
rsp
;
syncBuildSyncFwdRsp
(
&
rsp
,
pNode
->
vgId
,
version
,
code
);
syncBuildSyncFwdRsp
(
&
rsp
,
pNode
->
vgId
,
_
version
,
code
);
if
(
taosWriteMsg
(
pPeer
->
peerFd
,
&
rsp
,
sizeof
(
SFwdRsp
))
==
sizeof
(
SFwdRsp
))
{
if
(
taosWriteMsg
(
pPeer
->
peerFd
,
&
rsp
,
sizeof
(
SFwdRsp
))
==
sizeof
(
SFwdRsp
))
{
sTrace
(
"%s, forward-rsp is sent, code:0x%x hver:%"
PRIu64
,
pPeer
->
id
,
code
,
version
);
sTrace
(
"%s, forward-rsp is sent, code:0x%x hver:%"
PRIu64
,
pPeer
->
id
,
code
,
_
version
);
}
else
{
}
else
{
sDebug
(
"%s, failed to send forward-rsp, restart"
,
pPeer
->
id
);
sDebug
(
"%s, failed to send forward-rsp, restart"
,
pPeer
->
id
);
syncRestartConnection
(
pPeer
);
syncRestartConnection
(
pPeer
);
...
@@ -1302,14 +1302,14 @@ static void syncProcessBrokenLink(int64_t rid) {
...
@@ -1302,14 +1302,14 @@ static void syncProcessBrokenLink(int64_t rid) {
syncReleasePeer
(
pPeer
);
syncReleasePeer
(
pPeer
);
}
}
static
int32_t
syncSaveFwdInfo
(
SSyncNode
*
pNode
,
uint64_t
version
,
void
*
mhandle
)
{
static
int32_t
syncSaveFwdInfo
(
SSyncNode
*
pNode
,
uint64_t
_
version
,
void
*
mhandle
)
{
SSyncFwds
*
pSyncFwds
=
pNode
->
pSyncFwds
;
SSyncFwds
*
pSyncFwds
=
pNode
->
pSyncFwds
;
int64_t
time
=
taosGetTimestampMs
();
int64_t
time
=
taosGetTimestampMs
();
if
(
pSyncFwds
->
fwds
>=
SYNC_MAX_FWDS
)
{
if
(
pSyncFwds
->
fwds
>=
SYNC_MAX_FWDS
)
{
// pSyncFwds->first = (pSyncFwds->first + 1) % SYNC_MAX_FWDS;
// pSyncFwds->first = (pSyncFwds->first + 1) % SYNC_MAX_FWDS;
// pSyncFwds->fwds--;
// pSyncFwds->fwds--;
sError
(
"vgId:%d, failed to save fwd info, hver:%"
PRIu64
" fwds:%d"
,
pNode
->
vgId
,
version
,
pSyncFwds
->
fwds
);
sError
(
"vgId:%d, failed to save fwd info, hver:%"
PRIu64
" fwds:%d"
,
pNode
->
vgId
,
_
version
,
pSyncFwds
->
fwds
);
return
TSDB_CODE_SYN_TOO_MANY_FWDINFO
;
return
TSDB_CODE_SYN_TOO_MANY_FWDINFO
;
}
}
...
@@ -1319,12 +1319,12 @@ static int32_t syncSaveFwdInfo(SSyncNode *pNode, uint64_t version, void *mhandle
...
@@ -1319,12 +1319,12 @@ static int32_t syncSaveFwdInfo(SSyncNode *pNode, uint64_t version, void *mhandle
SFwdInfo
*
pFwdInfo
=
pSyncFwds
->
fwdInfo
+
pSyncFwds
->
last
;
SFwdInfo
*
pFwdInfo
=
pSyncFwds
->
fwdInfo
+
pSyncFwds
->
last
;
memset
(
pFwdInfo
,
0
,
sizeof
(
SFwdInfo
));
memset
(
pFwdInfo
,
0
,
sizeof
(
SFwdInfo
));
pFwdInfo
->
version
=
version
;
pFwdInfo
->
version
=
_
version
;
pFwdInfo
->
mhandle
=
mhandle
;
pFwdInfo
->
mhandle
=
mhandle
;
pFwdInfo
->
time
=
time
;
pFwdInfo
->
time
=
time
;
pSyncFwds
->
fwds
++
;
pSyncFwds
->
fwds
++
;
sTrace
(
"vgId:%d, fwd info is saved, hver:%"
PRIu64
" fwds:%d "
,
pNode
->
vgId
,
version
,
pSyncFwds
->
fwds
);
sTrace
(
"vgId:%d, fwd info is saved, hver:%"
PRIu64
" fwds:%d "
,
pNode
->
vgId
,
_
version
,
pSyncFwds
->
fwds
);
return
0
;
return
0
;
}
}
...
...
src/sync/src/syncMsg.c
浏览文件 @
2ba34f5e
...
@@ -61,13 +61,13 @@ void syncBuildSyncFwdMsg(SSyncHead *pHead, int32_t vgId, int32_t len) {
...
@@ -61,13 +61,13 @@ void syncBuildSyncFwdMsg(SSyncHead *pHead, int32_t vgId, int32_t len) {
syncBuildHead
(
pHead
);
syncBuildHead
(
pHead
);
}
}
void
syncBuildSyncFwdRsp
(
SFwdRsp
*
pMsg
,
int32_t
vgId
,
uint64_t
version
,
int32_t
code
)
{
void
syncBuildSyncFwdRsp
(
SFwdRsp
*
pMsg
,
int32_t
vgId
,
uint64_t
_
version
,
int32_t
code
)
{
pMsg
->
head
.
type
=
TAOS_SMSG_SYNC_FWD_RSP
;
pMsg
->
head
.
type
=
TAOS_SMSG_SYNC_FWD_RSP
;
pMsg
->
head
.
vgId
=
vgId
;
pMsg
->
head
.
vgId
=
vgId
;
pMsg
->
head
.
len
=
sizeof
(
SFwdRsp
)
-
sizeof
(
SSyncHead
);
pMsg
->
head
.
len
=
sizeof
(
SFwdRsp
)
-
sizeof
(
SSyncHead
);
syncBuildHead
(
&
pMsg
->
head
);
syncBuildHead
(
&
pMsg
->
head
);
pMsg
->
version
=
version
;
pMsg
->
version
=
_
version
;
pMsg
->
code
=
code
;
pMsg
->
code
=
code
;
}
}
...
...
src/tsdb/inc/tsdbMeta.h
浏览文件 @
2ba34f5e
...
@@ -69,7 +69,7 @@ void tsdbFreeMeta(STsdbMeta* pMeta);
...
@@ -69,7 +69,7 @@ void tsdbFreeMeta(STsdbMeta* pMeta);
int
tsdbOpenMeta
(
STsdbRepo
*
pRepo
);
int
tsdbOpenMeta
(
STsdbRepo
*
pRepo
);
int
tsdbCloseMeta
(
STsdbRepo
*
pRepo
);
int
tsdbCloseMeta
(
STsdbRepo
*
pRepo
);
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
uint64_t
uid
);
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
uint64_t
uid
);
STSchema
*
tsdbGetTableSchemaByVersion
(
STable
*
pTable
,
int16_t
version
);
STSchema
*
tsdbGetTableSchemaByVersion
(
STable
*
pTable
,
int16_t
_
version
);
int
tsdbWLockRepoMeta
(
STsdbRepo
*
pRepo
);
int
tsdbWLockRepoMeta
(
STsdbRepo
*
pRepo
);
int
tsdbRLockRepoMeta
(
STsdbRepo
*
pRepo
);
int
tsdbRLockRepoMeta
(
STsdbRepo
*
pRepo
);
int
tsdbUnlockRepoMeta
(
STsdbRepo
*
pRepo
);
int
tsdbUnlockRepoMeta
(
STsdbRepo
*
pRepo
);
...
@@ -89,16 +89,16 @@ static FORCE_INLINE int tsdbCompareSchemaVersion(const void *key1, const void *k
...
@@ -89,16 +89,16 @@ static FORCE_INLINE int tsdbCompareSchemaVersion(const void *key1, const void *k
}
}
}
}
static
FORCE_INLINE
STSchema
*
tsdbGetTableSchemaImpl
(
STable
*
pTable
,
bool
lock
,
bool
copy
,
int16_t
version
)
{
static
FORCE_INLINE
STSchema
*
tsdbGetTableSchemaImpl
(
STable
*
pTable
,
bool
lock
,
bool
copy
,
int16_t
_
version
)
{
STable
*
pDTable
=
(
TABLE_TYPE
(
pTable
)
==
TSDB_CHILD_TABLE
)
?
pTable
->
pSuper
:
pTable
;
STable
*
pDTable
=
(
TABLE_TYPE
(
pTable
)
==
TSDB_CHILD_TABLE
)
?
pTable
->
pSuper
:
pTable
;
STSchema
*
pSchema
=
NULL
;
STSchema
*
pSchema
=
NULL
;
STSchema
*
pTSchema
=
NULL
;
STSchema
*
pTSchema
=
NULL
;
if
(
lock
)
TSDB_RLOCK_TABLE
(
pDTable
);
if
(
lock
)
TSDB_RLOCK_TABLE
(
pDTable
);
if
(
version
<
0
)
{
// get the latest version of schema
if
(
_
version
<
0
)
{
// get the latest version of schema
pTSchema
=
pDTable
->
schema
[
pDTable
->
numOfSchemas
-
1
];
pTSchema
=
pDTable
->
schema
[
pDTable
->
numOfSchemas
-
1
];
}
else
{
// get the schema with version
}
else
{
// get the schema with version
void
*
ptr
=
taosbsearch
(
&
version
,
pDTable
->
schema
,
pDTable
->
numOfSchemas
,
sizeof
(
STSchema
*
),
void
*
ptr
=
taosbsearch
(
&
_
version
,
pDTable
->
schema
,
pDTable
->
numOfSchemas
,
sizeof
(
STSchema
*
),
tsdbCompareSchemaVersion
,
TD_EQ
);
tsdbCompareSchemaVersion
,
TD_EQ
);
if
(
ptr
==
NULL
)
{
if
(
ptr
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_IVD_TB_SCHEMA_VERSION
;
terrno
=
TSDB_CODE_TDB_IVD_TB_SCHEMA_VERSION
;
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
2ba34f5e
...
@@ -958,11 +958,11 @@ static int tsdbWriteBlockInfo(SCommitH *pCommih) {
...
@@ -958,11 +958,11 @@ static int tsdbWriteBlockInfo(SCommitH *pCommih) {
}
}
static
int
tsdbWriteBlockIdx
(
SCommitH
*
pCommih
)
{
static
int
tsdbWriteBlockIdx
(
SCommitH
*
pCommih
)
{
SBlockIdx
*
pBlkIdx
;
SBlockIdx
*
pBlkIdx
=
NULL
;
SDFile
*
pHeadf
=
TSDB_COMMIT_HEAD_FILE
(
pCommih
);
SDFile
*
pHeadf
=
TSDB_COMMIT_HEAD_FILE
(
pCommih
);
size_t
nidx
=
taosArrayGetSize
(
pCommih
->
aBlkIdx
);
size_t
nidx
=
taosArrayGetSize
(
pCommih
->
aBlkIdx
);
int
tlen
=
0
,
size
;
int
tlen
=
0
,
size
=
0
;
int64_t
offset
;
int64_t
offset
=
0
;
if
(
nidx
<=
0
)
{
if
(
nidx
<=
0
)
{
// All data are deleted
// All data are deleted
...
...
src/tsdb/src/tsdbFS.c
浏览文件 @
2ba34f5e
...
@@ -957,10 +957,10 @@ static int tsdbRestoreMeta(STsdbRepo *pRepo) {
...
@@ -957,10 +957,10 @@ static int tsdbRestoreMeta(STsdbRepo *pRepo) {
regfree
(
&
regex
);
regfree
(
&
regex
);
return
-
1
;
return
-
1
;
}
else
{
}
else
{
uint32_t
version
=
0
;
uint32_t
_
version
=
0
;
if
(
strcmp
(
bname
,
"meta"
)
!=
0
)
{
if
(
strcmp
(
bname
,
"meta"
)
!=
0
)
{
sscanf
(
bname
,
"meta-ver%"
PRIu32
,
&
version
);
sscanf
(
bname
,
"meta-ver%"
PRIu32
,
&
_
version
);
pfs
->
cstatus
->
meta
.
version
=
version
;
pfs
->
cstatus
->
meta
.
version
=
_
version
;
}
}
pfs
->
cstatus
->
pmf
=
&
(
pfs
->
cstatus
->
mf
);
pfs
->
cstatus
->
pmf
=
&
(
pfs
->
cstatus
->
mf
);
...
@@ -1103,10 +1103,10 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1103,10 +1103,10 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
int
tvid
,
tfid
;
int
tvid
,
tfid
;
TSDB_FILE_T
ttype
;
TSDB_FILE_T
ttype
;
uint32_t
tversion
;
uint32_t
tversion
;
char
bname
[
TSDB_FILENAME_LEN
];
char
_
bname
[
TSDB_FILENAME_LEN
];
tfsbasename
(
pf
,
bname
);
tfsbasename
(
pf
,
_
bname
);
tsdbParseDFilename
(
bname
,
&
tvid
,
&
tfid
,
&
ttype
,
&
tversion
);
tsdbParseDFilename
(
_
bname
,
&
tvid
,
&
tfid
,
&
ttype
,
&
tversion
);
ASSERT
(
tvid
==
REPO_ID
(
pRepo
));
ASSERT
(
tvid
==
REPO_ID
(
pRepo
));
...
...
src/tsdb/src/tsdbFile.c
浏览文件 @
2ba34f5e
...
@@ -410,7 +410,7 @@ int tsdbUpdateDFileHeader(SDFile *pDFile) {
...
@@ -410,7 +410,7 @@ int tsdbUpdateDFileHeader(SDFile *pDFile) {
int
tsdbLoadDFileHeader
(
SDFile
*
pDFile
,
SDFInfo
*
pInfo
)
{
int
tsdbLoadDFileHeader
(
SDFile
*
pDFile
,
SDFInfo
*
pInfo
)
{
char
buf
[
TSDB_FILE_HEAD_SIZE
]
=
"
\0
"
;
char
buf
[
TSDB_FILE_HEAD_SIZE
]
=
"
\0
"
;
uint32_t
version
;
uint32_t
_
version
;
ASSERT
(
TSDB_FILE_OPENED
(
pDFile
));
ASSERT
(
TSDB_FILE_OPENED
(
pDFile
));
...
@@ -428,7 +428,7 @@ int tsdbLoadDFileHeader(SDFile *pDFile, SDFInfo *pInfo) {
...
@@ -428,7 +428,7 @@ int tsdbLoadDFileHeader(SDFile *pDFile, SDFInfo *pInfo) {
}
}
void
*
pBuf
=
buf
;
void
*
pBuf
=
buf
;
pBuf
=
taosDecodeFixedU32
(
pBuf
,
&
version
);
pBuf
=
taosDecodeFixedU32
(
pBuf
,
&
_
version
);
pBuf
=
tsdbDecodeDFInfo
(
pBuf
,
pInfo
);
pBuf
=
tsdbDecodeDFInfo
(
pBuf
,
pInfo
);
return
0
;
return
0
;
}
}
...
@@ -660,12 +660,12 @@ int tsdbScanAndTryFixDFileSet(STsdbRepo *pRepo, SDFileSet *pSet) {
...
@@ -660,12 +660,12 @@ int tsdbScanAndTryFixDFileSet(STsdbRepo *pRepo, SDFileSet *pSet) {
return
0
;
return
0
;
}
}
int
tsdbParseDFilename
(
const
char
*
fname
,
int
*
vid
,
int
*
fid
,
TSDB_FILE_T
*
ftype
,
uint32_t
*
version
)
{
int
tsdbParseDFilename
(
const
char
*
fname
,
int
*
vid
,
int
*
fid
,
TSDB_FILE_T
*
ftype
,
uint32_t
*
_
version
)
{
char
*
p
=
NULL
;
char
*
p
=
NULL
;
*
version
=
0
;
*
_
version
=
0
;
*
ftype
=
TSDB_FILE_MAX
;
*
ftype
=
TSDB_FILE_MAX
;
sscanf
(
fname
,
"v%df%d.%m[a-z]-ver%"
PRIu32
,
vid
,
fid
,
&
p
,
version
);
sscanf
(
fname
,
"v%df%d.%m[a-z]-ver%"
PRIu32
,
vid
,
fid
,
&
p
,
_
version
);
for
(
TSDB_FILE_T
i
=
0
;
i
<
TSDB_FILE_MAX
;
i
++
)
{
for
(
TSDB_FILE_T
i
=
0
;
i
<
TSDB_FILE_MAX
;
i
++
)
{
if
(
strcmp
(
p
,
TSDB_FNAME_SUFFIX
[
i
])
==
0
)
{
if
(
strcmp
(
p
,
TSDB_FNAME_SUFFIX
[
i
])
==
0
)
{
*
ftype
=
i
;
*
ftype
=
i
;
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
2ba34f5e
...
@@ -531,8 +531,8 @@ STable *tsdbGetTableByUid(STsdbMeta *pMeta, uint64_t uid) {
...
@@ -531,8 +531,8 @@ STable *tsdbGetTableByUid(STsdbMeta *pMeta, uint64_t uid) {
return
*
(
STable
**
)
ptr
;
return
*
(
STable
**
)
ptr
;
}
}
STSchema
*
tsdbGetTableSchemaByVersion
(
STable
*
pTable
,
int16_t
version
)
{
STSchema
*
tsdbGetTableSchemaByVersion
(
STable
*
pTable
,
int16_t
_
version
)
{
return
tsdbGetTableSchemaImpl
(
pTable
,
true
,
false
,
version
);
return
tsdbGetTableSchemaImpl
(
pTable
,
true
,
false
,
_
version
);
}
}
int
tsdbWLockRepoMeta
(
STsdbRepo
*
pRepo
)
{
int
tsdbWLockRepoMeta
(
STsdbRepo
*
pRepo
)
{
...
@@ -891,9 +891,9 @@ static void tsdbRemoveTableFromMeta(STsdbRepo *pRepo, STable *pTable, bool rmFro
...
@@ -891,9 +891,9 @@ static void tsdbRemoveTableFromMeta(STsdbRepo *pRepo, STable *pTable, bool rmFro
maxCols
=
0
;
maxCols
=
0
;
maxRowBytes
=
0
;
maxRowBytes
=
0
;
for
(
int
i
=
0
;
i
<
pMeta
->
maxTables
;
i
++
)
{
for
(
int
i
=
0
;
i
<
pMeta
->
maxTables
;
i
++
)
{
STable
*
pTable
=
pMeta
->
tables
[
i
];
STable
*
_
pTable
=
pMeta
->
tables
[
i
];
if
(
pTable
!=
NULL
)
{
if
(
_
pTable
!=
NULL
)
{
pSchema
=
tsdbGetTableSchemaImpl
(
pTable
,
false
,
false
,
-
1
);
pSchema
=
tsdbGetTableSchemaImpl
(
_
pTable
,
false
,
false
,
-
1
);
maxCols
=
MAX
(
maxCols
,
schemaNCols
(
pSchema
));
maxCols
=
MAX
(
maxCols
,
schemaNCols
(
pSchema
));
maxRowBytes
=
MAX
(
maxRowBytes
,
schemaTLen
(
pSchema
));
maxRowBytes
=
MAX
(
maxRowBytes
,
schemaTLen
(
pSchema
));
}
}
...
...
src/util/src/tdes.c
浏览文件 @
2ba34f5e
...
@@ -155,26 +155,26 @@ void generate_key(unsigned char* key) {
...
@@ -155,26 +155,26 @@ void generate_key(unsigned char* key) {
}
}
}
}
void
print_key_set
(
key_set
key_set
)
{
void
print_key_set
(
key_set
_
key_set
)
{
int
i
;
int
i
;
printf
(
"K:
\n
"
);
printf
(
"K:
\n
"
);
for
(
i
=
0
;
i
<
8
;
i
++
)
{
for
(
i
=
0
;
i
<
8
;
i
++
)
{
printf
(
"%02X : "
,
key_set
.
k
[
i
]);
printf
(
"%02X : "
,
_
key_set
.
k
[
i
]);
print_char_as_binary
(
key_set
.
k
[
i
]);
print_char_as_binary
(
_
key_set
.
k
[
i
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
printf
(
"
\n
C:
\n
"
);
printf
(
"
\n
C:
\n
"
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
printf
(
"%02X : "
,
key_set
.
c
[
i
]);
printf
(
"%02X : "
,
_
key_set
.
c
[
i
]);
print_char_as_binary
(
key_set
.
c
[
i
]);
print_char_as_binary
(
_
key_set
.
c
[
i
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
printf
(
"
\n
D:
\n
"
);
printf
(
"
\n
D:
\n
"
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
printf
(
"%02X : "
,
key_set
.
d
[
i
]);
printf
(
"%02X : "
,
_
key_set
.
d
[
i
]);
print_char_as_binary
(
key_set
.
d
[
i
]);
print_char_as_binary
(
_
key_set
.
d
[
i
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
...
src/wal/src/walWrite.c
浏览文件 @
2ba34f5e
...
@@ -199,7 +199,7 @@ int32_t walRestore(void *handle, void *pVnode, FWalWrite writeFp) {
...
@@ -199,7 +199,7 @@ int32_t walRestore(void *handle, void *pVnode, FWalWrite writeFp) {
snprintf
(
walName
,
sizeof
(
pWal
->
name
),
"%s/%s%"
PRId64
,
pWal
->
path
,
WAL_PREFIX
,
fileId
);
snprintf
(
walName
,
sizeof
(
pWal
->
name
),
"%s/%s%"
PRId64
,
pWal
->
path
,
WAL_PREFIX
,
fileId
);
wInfo
(
"vgId:%d, file:%s, will be restored"
,
pWal
->
vgId
,
walName
);
wInfo
(
"vgId:%d, file:%s, will be restored"
,
pWal
->
vgId
,
walName
);
int32_t
code
=
walRestoreWalFile
(
pWal
,
pVnode
,
writeFp
,
walName
,
fileId
);
code
=
walRestoreWalFile
(
pWal
,
pVnode
,
writeFp
,
walName
,
fileId
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
wError
(
"vgId:%d, file:%s, failed to restore since %s"
,
pWal
->
vgId
,
walName
,
tstrerror
(
code
));
wError
(
"vgId:%d, file:%s, failed to restore since %s"
,
pWal
->
vgId
,
walName
,
tstrerror
(
code
));
continue
;
continue
;
...
...
tests/comparisonTest/tdengine/tdengineTest.c
浏览文件 @
2ba34f5e
...
@@ -189,8 +189,8 @@ void writeDataImp(void *param) {
...
@@ -189,8 +189,8 @@ void writeDataImp(void *param) {
counter
++
;
counter
++
;
if
(
counter
>=
arguments
.
rowsPerRequest
)
{
if
(
counter
>=
arguments
.
rowsPerRequest
)
{
TAOS_RES
*
result
=
taos_query
(
taos
,
sql
);
result
=
taos_query
(
taos
,
sql
);
int32_t
code
=
taos_errno
(
result
);
code
=
taos_errno
(
result
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
printf
(
"thread:%d error:%d reason:%s
\n
"
,
pThread
->
threadId
,
code
,
taos_errstr
(
taos
));
printf
(
"thread:%d error:%d reason:%s
\n
"
,
pThread
->
threadId
,
code
,
taos_errstr
(
taos
));
}
}
...
@@ -207,8 +207,8 @@ void writeDataImp(void *param) {
...
@@ -207,8 +207,8 @@ void writeDataImp(void *param) {
}
}
if
(
counter
>
0
)
{
if
(
counter
>
0
)
{
TAOS_RES
*
result
=
taos_query
(
taos
,
sql
);
result
=
taos_query
(
taos
,
sql
);
int32_t
code
=
taos_errno
(
result
);
code
=
taos_errno
(
result
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
printf
(
"thread:%d error:%d reason:%s
\n
"
,
pThread
->
threadId
,
code
,
taos_errstr
(
taos
));
printf
(
"thread:%d error:%d reason:%s
\n
"
,
pThread
->
threadId
,
code
,
taos_errstr
(
taos
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录