Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
cf93ca70
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cf93ca70
编写于
5月 14, 2021
作者:
Z
ZhongChunHe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix declaration shadows previous local/global errors
上级
65471ac1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
60 addition
and
60 deletion
+60
-60
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
+2
-2
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+1
-1
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+3
-3
tests/comparisonTest/tdengine/tdengineTest.c
tests/comparisonTest/tdengine/tdengineTest.c
+4
-4
未找到文件。
src/connector/odbc/examples/c/main.c
浏览文件 @
cf93ca70
...
...
@@ -18,8 +18,8 @@
#define CHK_TEST(statement) \
do { \
D("testing: %s", #statement); \
int r = (statement); \
if (r) { \
int
_
r = (statement); \
if (
_
r) { \
D("testing failed: %s", #statement); \
return 1; \
} \
...
...
@@ -181,7 +181,7 @@ static int do_statement(SQLHSTMT stmt, const char *statement) {
r
=
traverse_cols
(
stmt
,
cols
);
char
buf
[
4096
];
while
(
1
)
{
SQLRETURN
r
=
SQLFetch
(
stmt
);
r
=
SQLFetch
(
stmt
);
if
(
r
==
SQL_NO_DATA
)
break
;
CHK_RESULT
(
r
,
SQL_HANDLE_STMT
,
stmt
,
""
);
for
(
size_t
i
=
0
;
i
<
cols
;
++
i
)
{
...
...
src/connector/odbc/src/base/tsdb_impl.c
浏览文件 @
cf93ca70
...
...
@@ -1762,8 +1762,8 @@ static SQLRETURN tsdb_conn_prepare(stmt_t *stmt) {
tsdb_stmt
->
tsdb_params
=
tsdb_params
;
for
(
int
i
=
0
;
i
<
nums
;
++
i
)
{
SQLRETURN
r
=
do_fill_param
(
stmt
,
i
);
if
(
r
)
return
r
;
SQLRETURN
_
r
=
do_fill_param
(
stmt
,
i
);
if
(
_r
)
return
_
r
;
}
}
...
...
src/kit/shell/src/shellCheck.c
浏览文件 @
cf93ca70
...
...
@@ -148,15 +148,15 @@ static void *shellCheckThreadFp(void *arg) {
return
NULL
;
}
static
void
shellRunCheckThreads
(
TAOS
*
con
,
SShellArguments
*
args
)
{
static
void
shellRunCheckThreads
(
TAOS
*
con
,
SShellArguments
*
_
args
)
{
pthread_attr_t
thattr
;
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
_
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
ShellThreadObj
*
pThread
=
threadObj
+
t
;
pThread
->
threadIndex
=
t
;
pThread
->
totalThreads
=
args
->
threadNum
;
pThread
->
totalThreads
=
_
args
->
threadNum
;
pThread
->
taos
=
con
;
pThread
->
db
=
args
->
database
;
pThread
->
db
=
_
args
->
database
;
pthread_attr_init
(
&
thattr
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
...
...
@@ -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
);
}
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
taos_close
(
threadObj
[
t
].
taos
);
}
free
(
threadObj
);
}
void
shellCheck
(
TAOS
*
con
,
SShellArguments
*
args
)
{
void
shellCheck
(
TAOS
*
con
,
SShellArguments
*
_
args
)
{
int64_t
start
=
taosGetTimestampMs
();
if
(
shellUseDb
(
con
,
args
->
database
)
!=
0
)
{
if
(
shellUseDb
(
con
,
_
args
->
database
)
!=
0
)
{
shellFreeTbnames
();
return
;
}
if
(
shellShowTables
(
con
,
args
->
database
)
!=
0
)
{
if
(
shellShowTables
(
con
,
_
args
->
database
)
!=
0
)
{
shellFreeTbnames
();
return
;
}
fprintf
(
stdout
,
"total %d tables will be checked by %d threads
\n
"
,
tbNum
,
args
->
threadNum
);
shellRunCheckThreads
(
con
,
args
);
fprintf
(
stdout
,
"total %d tables will be checked by %d threads
\n
"
,
tbNum
,
_
args
->
threadNum
);
shellRunCheckThreads
(
con
,
_
args
);
int64_t
end
=
taosGetTimestampMs
();
fprintf
(
stdout
,
"total %d tables checked, failed:%d, time spent %.2f seconds
\n
"
,
checkedNum
,
errorNum
,
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
cf93ca70
...
...
@@ -56,24 +56,24 @@ extern TAOS *taos_connect_auth(const char *ip, const char *user, const char *aut
/*
* FUNCTION: Initialize the shell.
*/
TAOS
*
shellInit
(
SShellArguments
*
args
)
{
TAOS
*
shellInit
(
SShellArguments
*
_
args
)
{
printf
(
"
\n
"
);
printf
(
CLIENT_VERSION
,
tsOsName
,
taos_get_client_info
());
fflush
(
stdout
);
// set options before initializing
if
(
args
->
timezone
!=
NULL
)
{
taos_options
(
TSDB_OPTION_TIMEZONE
,
args
->
timezone
);
if
(
_
args
->
timezone
!=
NULL
)
{
taos_options
(
TSDB_OPTION_TIMEZONE
,
_
args
->
timezone
);
}
if
(
args
->
is_use_passwd
)
{
if
(
args
->
password
==
NULL
)
args
->
password
=
getpass
(
"Enter password: "
);
if
(
_
args
->
is_use_passwd
)
{
if
(
_args
->
password
==
NULL
)
_
args
->
password
=
getpass
(
"Enter password: "
);
}
else
{
args
->
password
=
TSDB_DEFAULT_PASS
;
_
args
->
password
=
TSDB_DEFAULT_PASS
;
}
if
(
args
->
user
==
NULL
)
{
args
->
user
=
TSDB_DEFAULT_USER
;
if
(
_
args
->
user
==
NULL
)
{
_
args
->
user
=
TSDB_DEFAULT_USER
;
}
if
(
taos_init
())
{
...
...
@@ -84,10 +84,10 @@ TAOS *shellInit(SShellArguments *args) {
// Connect to the database.
TAOS
*
con
=
NULL
;
if
(
args
->
auth
==
NULL
)
{
con
=
taos_connect
(
args
->
host
,
args
->
user
,
args
->
password
,
args
->
database
,
args
->
port
);
if
(
_
args
->
auth
==
NULL
)
{
con
=
taos_connect
(
_args
->
host
,
_args
->
user
,
_args
->
password
,
_args
->
database
,
_
args
->
port
);
}
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
)
{
...
...
@@ -100,14 +100,14 @@ TAOS *shellInit(SShellArguments *args) {
read_history
();
// Check if it is temperory run
if
(
args
->
commands
!=
NULL
||
args
->
file
[
0
]
!=
0
)
{
if
(
args
->
commands
!=
NULL
)
{
printf
(
"%s%s
\n
"
,
PROMPT_HEADER
,
args
->
commands
);
shellRunCommand
(
con
,
args
->
commands
);
if
(
_args
->
commands
!=
NULL
||
_
args
->
file
[
0
]
!=
0
)
{
if
(
_
args
->
commands
!=
NULL
)
{
printf
(
"%s%s
\n
"
,
PROMPT_HEADER
,
_
args
->
commands
);
shellRunCommand
(
con
,
_
args
->
commands
);
}
if
(
args
->
file
[
0
]
!=
0
)
{
source_file
(
con
,
args
->
file
);
if
(
_
args
->
file
[
0
]
!=
0
)
{
source_file
(
con
,
_
args
->
file
);
}
taos_close
(
con
);
...
...
@@ -116,14 +116,14 @@ TAOS *shellInit(SShellArguments *args) {
}
#ifndef WINDOWS
if
(
args
->
dir
[
0
]
!=
0
)
{
source_dir
(
con
,
args
);
if
(
_
args
->
dir
[
0
]
!=
0
)
{
source_dir
(
con
,
_
args
);
taos_close
(
con
);
exit
(
EXIT_SUCCESS
);
}
if
(
args
->
check
!=
0
)
{
shellCheck
(
con
,
args
);
if
(
_
args
->
check
!=
0
)
{
shellCheck
(
con
,
_
args
);
taos_close
(
con
);
exit
(
EXIT_SUCCESS
);
}
...
...
src/kit/shell/src/shellImport.c
浏览文件 @
cf93ca70
...
...
@@ -233,15 +233,15 @@ void* shellImportThreadFp(void *arg)
return
NULL
;
}
static
void
shellRunImportThreads
(
SShellArguments
*
args
)
static
void
shellRunImportThreads
(
SShellArguments
*
_
args
)
{
pthread_attr_t
thattr
;
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
ShellThreadObj
*
threadObj
=
(
ShellThreadObj
*
)
calloc
(
_
args
->
threadNum
,
sizeof
(
ShellThreadObj
));
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
ShellThreadObj
*
pThread
=
threadObj
+
t
;
pThread
->
threadIndex
=
t
;
pThread
->
totalThreads
=
args
->
threadNum
;
pThread
->
taos
=
taos_connect
(
args
->
host
,
args
->
user
,
args
->
password
,
args
->
database
,
tsDnodeShellPort
);
pThread
->
totalThreads
=
_
args
->
threadNum
;
pThread
->
taos
=
taos_connect
(
_args
->
host
,
_args
->
user
,
_args
->
password
,
_
args
->
database
,
tsDnodeShellPort
);
if
(
pThread
->
taos
==
NULL
)
{
fprintf
(
stderr
,
"ERROR: thread:%d failed connect to TDengine, error:%s
\n
"
,
pThread
->
threadIndex
,
"null taos"
/*taos_errstr(pThread->taos)*/
);
exit
(
0
);
...
...
@@ -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
);
}
for
(
int
t
=
0
;
t
<
args
->
threadNum
;
++
t
)
{
for
(
int
t
=
0
;
t
<
_
args
->
threadNum
;
++
t
)
{
taos_close
(
threadObj
[
t
].
taos
);
}
free
(
threadObj
);
}
void
source_dir
(
TAOS
*
con
,
SShellArguments
*
args
)
{
shellGetDirectoryFileList
(
args
->
dir
);
void
source_dir
(
TAOS
*
con
,
SShellArguments
*
_
args
)
{
shellGetDirectoryFileList
(
_
args
->
dir
);
int64_t
start
=
taosGetTimestampMs
();
if
(
shellTablesSQLFile
[
0
]
!=
0
)
{
...
...
@@ -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
);
}
shellRunImportThreads
(
args
);
shellRunImportThreads
(
_
args
);
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
浏览文件 @
cf93ca70
...
...
@@ -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
)
{
struct
winsize
w
;
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
cf93ca70
...
...
@@ -3884,7 +3884,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
}
cJSON
*
maxSqlLen
=
cJSON_GetObjectItem
(
stbInfo
,
"max_sql_len"
);
maxSqlLen
=
cJSON_GetObjectItem
(
stbInfo
,
"max_sql_len"
);
if
(
maxSqlLen
&&
maxSqlLen
->
type
==
cJSON_Number
)
{
int32_t
len
=
maxSqlLen
->
valueint
;
if
(
len
>
TSDB_MAX_ALLOWED_SQL_LEN
)
{
...
...
@@ -3918,7 +3918,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto PARSE_OVER;
}
*/
cJSON
*
interlaceRows
=
cJSON_GetObjectItem
(
stbInfo
,
"interlace_rows"
);
interlaceRows
=
cJSON_GetObjectItem
(
stbInfo
,
"interlace_rows"
);
if
(
interlaceRows
&&
interlaceRows
->
type
==
cJSON_Number
)
{
if
(
interlaceRows
->
valueint
<
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, interlace rows input mistake
\n
"
,
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
cf93ca70
...
...
@@ -1017,7 +1017,7 @@ int taosDumpOut(struct arguments *arguments) {
sprintf
(
command
,
"use %s"
,
dbInfos
[
0
]
->
name
);
result
=
taos_query
(
taos
,
command
);
int32_t
code
=
taos_errno
(
result
);
code
=
taos_errno
(
result
);
if
(
code
!=
0
)
{
fprintf
(
stderr
,
"invalid database %s
\n
"
,
dbInfos
[
0
]
->
name
);
goto
_exit_failure
;
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
cf93ca70
...
...
@@ -958,11 +958,11 @@ static int tsdbWriteBlockInfo(SCommitH *pCommih) {
}
static
int
tsdbWriteBlockIdx
(
SCommitH
*
pCommih
)
{
SBlockIdx
*
pBlkIdx
;
SBlockIdx
*
pBlkIdx
=
NULL
;
SDFile
*
pHeadf
=
TSDB_COMMIT_HEAD_FILE
(
pCommih
);
size_t
nidx
=
taosArrayGetSize
(
pCommih
->
aBlkIdx
);
int
tlen
=
0
,
size
;
int64_t
offset
;
int
tlen
=
0
,
size
=
0
;
int64_t
offset
=
0
;
if
(
nidx
<=
0
)
{
// All data are deleted
...
...
tests/comparisonTest/tdengine/tdengineTest.c
浏览文件 @
cf93ca70
...
...
@@ -189,8 +189,8 @@ void writeDataImp(void *param) {
counter
++
;
if
(
counter
>=
arguments
.
rowsPerRequest
)
{
TAOS_RES
*
result
=
taos_query
(
taos
,
sql
);
int32_t
code
=
taos_errno
(
result
);
result
=
taos_query
(
taos
,
sql
);
code
=
taos_errno
(
result
);
if
(
code
!=
0
)
{
printf
(
"thread:%d error:%d reason:%s
\n
"
,
pThread
->
threadId
,
code
,
taos_errstr
(
taos
));
}
...
...
@@ -207,8 +207,8 @@ void writeDataImp(void *param) {
}
if
(
counter
>
0
)
{
TAOS_RES
*
result
=
taos_query
(
taos
,
sql
);
int32_t
code
=
taos_errno
(
result
);
result
=
taos_query
(
taos
,
sql
);
code
=
taos_errno
(
result
);
if
(
code
!=
0
)
{
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录