Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XKZJ_WCL
TDengine
提交
e32e507e
T
TDengine
项目概览
XKZJ_WCL
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e32e507e
编写于
9月 28, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1530
上级
ca028a3d
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
37 addition
and
36 deletion
+37
-36
cmake/define.inc
cmake/define.inc
+3
-3
src/common/src/ttypes.c
src/common/src/ttypes.c
+4
-4
src/common/src/tvariant.c
src/common/src/tvariant.c
+8
-8
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/os/inc/os.h
src/os/inc/os.h
+3
-3
src/os/src/detail/CMakeLists.txt
src/os/src/detail/CMakeLists.txt
+2
-2
src/os/src/linux/ningsi.c
src/os/src/linux/ningsi.c
+1
-1
src/plugins/http/src/httpGcJson.c
src/plugins/http/src/httpGcJson.c
+1
-1
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+5
-5
src/sync/src/syncRetrieve.c
src/sync/src/syncRetrieve.c
+1
-1
src/sync/test/syncServer.c
src/sync/test/syncServer.c
+1
-1
src/wal/test/waltest.c
src/wal/test/waltest.c
+2
-2
tests/comparisonTest/tdengine/tdengineTest.c
tests/comparisonTest/tdengine/tdengineTest.c
+1
-1
tests/examples/c/demo.c
tests/examples/c/demo.c
+2
-1
tests/tsim/src/simExe.c
tests/tsim/src/simExe.c
+2
-2
未找到文件。
cmake/define.inc
浏览文件 @
e32e507e
...
@@ -62,7 +62,7 @@ ENDIF ()
...
@@ -62,7 +62,7 @@ ENDIF ()
IF
(
TD_ARM_64
)
IF
(
TD_ARM_64
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_ARM_64
_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_64
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"arm64 is defined"
)
MESSAGE
(
STATUS
"arm64 is defined"
)
...
@@ -70,7 +70,7 @@ IF (TD_ARM_64)
...
@@ -70,7 +70,7 @@ IF (TD_ARM_64)
ENDIF
()
ENDIF
()
IF
(
TD_ARM_32
)
IF
(
TD_ARM_32
)
ADD_DEFINITIONS
(
-
D_TD_ARM_32
_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_32
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
MESSAGE
(
STATUS
"arm32 is defined"
)
MESSAGE
(
STATUS
"arm32 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types "
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types "
)
...
@@ -102,7 +102,7 @@ IF (TD_LINUX)
...
@@ -102,7 +102,7 @@ IF (TD_LINUX)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
IF
(
TD_NINGSI_60
)
IF
(
TD_NINGSI_60
)
ADD_DEFINITIONS
(
-
D_TD_NINGSI_60
_
)
ADD_DEFINITIONS
(
-
D_TD_NINGSI_60
)
MESSAGE
(
STATUS
"set ningsi macro to true"
)
MESSAGE
(
STATUS
"set ningsi macro to true"
)
ENDIF
()
ENDIF
()
...
...
src/common/src/ttypes.c
浏览文件 @
e32e507e
...
@@ -235,7 +235,7 @@ static void getStatics_f(const TSKEY *primaryKey, const void *pData, int32_t num
...
@@ -235,7 +235,7 @@ static void getStatics_f(const TSKEY *primaryKey, const void *pData, int32_t num
double
csum
=
0
;
double
csum
=
0
;
csum
=
GET_DOUBLE_VAL
(
sum
);
csum
=
GET_DOUBLE_VAL
(
sum
);
csum
+=
dsum
;
csum
+=
dsum
;
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
SET_DOUBLE_VAL_ALIGN
(
sum
,
&
csum
);
SET_DOUBLE_VAL_ALIGN
(
sum
,
&
csum
);
SET_DOUBLE_VAL_ALIGN
(
max
,
&
fmax
);
SET_DOUBLE_VAL_ALIGN
(
max
,
&
fmax
);
SET_DOUBLE_VAL_ALIGN
(
min
,
&
fmin
);
SET_DOUBLE_VAL_ALIGN
(
min
,
&
fmin
);
...
@@ -282,7 +282,7 @@ static void getStatics_d(const TSKEY *primaryKey, const void *pData, int32_t num
...
@@ -282,7 +282,7 @@ static void getStatics_d(const TSKEY *primaryKey, const void *pData, int32_t num
csum
+=
dsum
;
csum
+=
dsum
;
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
SET_DOUBLE_VAL_ALIGN
(
sum
,
&
csum
);
SET_DOUBLE_VAL_ALIGN
(
sum
,
&
csum
);
SET_DOUBLE_VAL_ALIGN
(
max
,
&
dmax
);
SET_DOUBLE_VAL_ALIGN
(
max
,
&
dmax
);
SET_DOUBLE_VAL_ALIGN
(
min
,
&
dmin
);
SET_DOUBLE_VAL_ALIGN
(
min
,
&
dmin
);
...
@@ -494,7 +494,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
...
@@ -494,7 +494,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
break
;
break
;
}
}
case
TSDB_DATA_TYPE_FLOAT
:
{
case
TSDB_DATA_TYPE_FLOAT
:
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
float
fv
=
GET_FLOAT_VAL
(
src
);
float
fv
=
GET_FLOAT_VAL
(
src
);
SET_FLOAT_VAL_ALIGN
(
val
,
&
fv
);
SET_FLOAT_VAL_ALIGN
(
val
,
&
fv
);
#else
#else
...
@@ -503,7 +503,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
...
@@ -503,7 +503,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
break
;
break
;
};
};
case
TSDB_DATA_TYPE_DOUBLE
:
{
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
double
dv
=
GET_DOUBLE_VAL
(
src
);
double
dv
=
GET_DOUBLE_VAL
(
src
);
SET_DOUBLE_VAL_ALIGN
(
val
,
&
dv
);
SET_DOUBLE_VAL_ALIGN
(
val
,
&
dv
);
#else
#else
...
...
src/common/src/tvariant.c
浏览文件 @
e32e507e
...
@@ -709,7 +709,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
...
@@ -709,7 +709,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
return
-
1
;
return
-
1
;
}
}
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
//memcpy(&payload, &value, sizeof(float));
//memcpy(&payload, &value, sizeof(float));
float
fv
=
(
float
)
value
;
float
fv
=
(
float
)
value
;
SET_FLOAT_VAL_ALIGN
(
payload
,
&
fv
);
SET_FLOAT_VAL_ALIGN
(
payload
,
&
fv
);
...
@@ -718,7 +718,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
...
@@ -718,7 +718,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
#endif
#endif
}
}
}
else
if
(
pVariant
->
nType
>=
TSDB_DATA_TYPE_BOOL
&&
pVariant
->
nType
<=
TSDB_DATA_TYPE_BIGINT
)
{
}
else
if
(
pVariant
->
nType
>=
TSDB_DATA_TYPE_BOOL
&&
pVariant
->
nType
<=
TSDB_DATA_TYPE_BIGINT
)
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
//memcpy(&payload, &pVariant->i64Key, sizeof(float));
//memcpy(&payload, &pVariant->i64Key, sizeof(float));
float
fv
=
(
float
)
pVariant
->
i64Key
;
float
fv
=
(
float
)
pVariant
->
i64Key
;
SET_FLOAT_VAL_ALIGN
(
payload
,
&
fv
);
SET_FLOAT_VAL_ALIGN
(
payload
,
&
fv
);
...
@@ -726,7 +726,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
...
@@ -726,7 +726,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
*
((
float
*
)
payload
)
=
(
float
)
pVariant
->
i64Key
;
*
((
float
*
)
payload
)
=
(
float
)
pVariant
->
i64Key
;
#endif
#endif
}
else
if
(
pVariant
->
nType
==
TSDB_DATA_TYPE_DOUBLE
||
pVariant
->
nType
==
TSDB_DATA_TYPE_FLOAT
)
{
}
else
if
(
pVariant
->
nType
==
TSDB_DATA_TYPE_DOUBLE
||
pVariant
->
nType
==
TSDB_DATA_TYPE_FLOAT
)
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
//memcpy(&payload, &pVariant->dKey, sizeof(float));
//memcpy(&payload, &pVariant->dKey, sizeof(float));
float
fv
=
(
float
)
pVariant
->
dKey
;
float
fv
=
(
float
)
pVariant
->
dKey
;
SET_FLOAT_VAL_ALIGN
(
payload
,
&
fv
);
SET_FLOAT_VAL_ALIGN
(
payload
,
&
fv
);
...
@@ -738,7 +738,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
...
@@ -738,7 +738,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
return
0
;
return
0
;
}
}
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
float
fv
=
GET_FLOAT_VAL
(
payload
);
float
fv
=
GET_FLOAT_VAL
(
payload
);
if
(
isinf
(
fv
)
||
isnan
(
fv
)
||
fv
>
FLT_MAX
||
fv
<
-
FLT_MAX
)
{
if
(
isinf
(
fv
)
||
isnan
(
fv
)
||
fv
>
FLT_MAX
||
fv
<
-
FLT_MAX
)
{
return
-
1
;
return
-
1
;
...
@@ -765,21 +765,21 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
...
@@ -765,21 +765,21 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
return
-
1
;
return
-
1
;
}
}
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
SET_DOUBLE_VAL_ALIGN
(
payload
,
&
value
);
SET_DOUBLE_VAL_ALIGN
(
payload
,
&
value
);
#else
#else
*
((
double
*
)
payload
)
=
value
;
*
((
double
*
)
payload
)
=
value
;
#endif
#endif
}
}
}
else
if
(
pVariant
->
nType
>=
TSDB_DATA_TYPE_BOOL
&&
pVariant
->
nType
<=
TSDB_DATA_TYPE_BIGINT
)
{
}
else
if
(
pVariant
->
nType
>=
TSDB_DATA_TYPE_BOOL
&&
pVariant
->
nType
<=
TSDB_DATA_TYPE_BIGINT
)
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
double
dv
=
(
double
)(
pVariant
->
i64Key
);
double
dv
=
(
double
)(
pVariant
->
i64Key
);
SET_DOUBLE_VAL_ALIGN
(
payload
,
&
dv
);
SET_DOUBLE_VAL_ALIGN
(
payload
,
&
dv
);
#else
#else
*
((
double
*
)
payload
)
=
(
double
)
pVariant
->
i64Key
;
*
((
double
*
)
payload
)
=
(
double
)
pVariant
->
i64Key
;
#endif
#endif
}
else
if
(
pVariant
->
nType
==
TSDB_DATA_TYPE_DOUBLE
||
pVariant
->
nType
==
TSDB_DATA_TYPE_FLOAT
)
{
}
else
if
(
pVariant
->
nType
==
TSDB_DATA_TYPE_DOUBLE
||
pVariant
->
nType
==
TSDB_DATA_TYPE_FLOAT
)
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
double
dv
=
(
double
)(
pVariant
->
dKey
);
double
dv
=
(
double
)(
pVariant
->
dKey
);
SET_DOUBLE_VAL_ALIGN
(
payload
,
&
dv
);
SET_DOUBLE_VAL_ALIGN
(
payload
,
&
dv
);
#else
#else
...
@@ -790,7 +790,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
...
@@ -790,7 +790,7 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool inclu
return
0
;
return
0
;
}
}
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
double
dv
=
GET_DOUBLE_VAL
(
payload
);
double
dv
=
GET_DOUBLE_VAL
(
payload
);
if
(
isinf
(
dv
)
||
isnan
(
dv
)
||
dv
>
DBL_MAX
||
dv
<
-
DBL_MAX
)
{
if
(
isinf
(
dv
)
||
isnan
(
dv
)
||
dv
>
DBL_MAX
||
dv
<
-
DBL_MAX
)
{
return
-
1
;
return
-
1
;
...
...
src/inc/taosdef.h
浏览文件 @
e32e507e
...
@@ -131,7 +131,7 @@ do { \
...
@@ -131,7 +131,7 @@ do { \
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
#define GET_FLOAT_VAL(x) taos_align_get_float(x)
#define GET_FLOAT_VAL(x) taos_align_get_float(x)
#define GET_DOUBLE_VAL(x) taos_align_get_double(x)
#define GET_DOUBLE_VAL(x) taos_align_get_double(x)
...
...
src/os/inc/os.h
浏览文件 @
e32e507e
...
@@ -24,11 +24,11 @@ extern "C" {
...
@@ -24,11 +24,11 @@ extern "C" {
#include "osDarwin.h"
#include "osDarwin.h"
#endif
#endif
#ifdef _TD_ARM_64
_
#ifdef _TD_ARM_64
#include "osArm64.h"
#include "osArm64.h"
#endif
#endif
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
#include "osArm32.h"
#include "osArm32.h"
#endif
#endif
...
@@ -44,7 +44,7 @@ extern "C" {
...
@@ -44,7 +44,7 @@ extern "C" {
#include "osAlpine.h"
#include "osAlpine.h"
#endif
#endif
#ifdef _TD_NINGSI_60
_
#ifdef _TD_NINGSI_60
#include "osNingsi.h"
#include "osNingsi.h"
#endif
#endif
...
...
src/os/src/detail/CMakeLists.txt
浏览文件 @
e32e507e
...
@@ -10,6 +10,6 @@ SET_SOURCE_FILES_PROPERTIES(osCoredump.c PROPERTIES COMPILE_FLAGS -w)
...
@@ -10,6 +10,6 @@ SET_SOURCE_FILES_PROPERTIES(osCoredump.c PROPERTIES COMPILE_FLAGS -w)
ADD_LIBRARY
(
osdetail
${
SRC
}
)
ADD_LIBRARY
(
osdetail
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
osdetail os
)
TARGET_LINK_LIBRARIES
(
osdetail os
)
IF
(
TD_ARM_
64
)
IF
(
TD_ARM_
32
)
TARGET_LINK_LIBRARIES
(
osdetail atomic
)
TARGET_LINK_LIBRARIES
(
osdetail atomic
)
ENDIF
()
ENDIF
()
src/os/src/linux/ningsi.c
浏览文件 @
e32e507e
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#ifdef _TD_NINGSI_60
_
#ifdef _TD_NINGSI_60
void
*
atomic_exchange_ptr_impl
(
void
**
ptr
,
void
*
val
)
{
void
*
atomic_exchange_ptr_impl
(
void
**
ptr
,
void
*
val
)
{
void
*
old
;
void
*
old
;
do
{
do
{
...
...
src/plugins/http/src/httpGcJson.c
浏览文件 @
e32e507e
...
@@ -145,7 +145,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
...
@@ -145,7 +145,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d,"
,
fields
[
i
].
name
,
*
((
int32_t
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d,"
,
fields
[
i
].
name
,
*
((
int32_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_BIGINT
:
case
TSDB_DATA_TYPE_BIGINT
:
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%
ld"
,
fields
[
i
].
name
,
*
((
int64_t
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%
"
PRId64
,
fields
[
i
].
name
,
*
((
int64_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_FLOAT
:
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%.5f"
,
fields
[
i
].
name
,
*
((
float
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%.5f"
,
fields
[
i
].
name
,
*
((
float
*
)
row
[
i
]));
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
e32e507e
...
@@ -113,7 +113,7 @@ int32_t httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) {
...
@@ -113,7 +113,7 @@ int32_t httpWriteJsonBufBody(JsonBuf* buf, bool isTheLast) {
httpTrace
(
"context:%p, fd:%d, no data need dump"
,
buf
->
pContext
,
buf
->
pContext
->
fd
);
httpTrace
(
"context:%p, fd:%d, no data need dump"
,
buf
->
pContext
,
buf
->
pContext
->
fd
);
return
0
;
// there is no data to dump.
return
0
;
// there is no data to dump.
}
else
{
}
else
{
int32_t
len
=
sprintf
(
sLen
,
"%
lx
\r\n
"
,
srcLen
);
int32_t
len
=
sprintf
(
sLen
,
"%
"
PRIx64
"
\r\n
"
,
srcLen
);
httpTrace
(
"context:%p, fd:%d, write body, chunkSize:%"
PRIu64
", response:
\n
%s"
,
buf
->
pContext
,
buf
->
pContext
->
fd
,
httpTrace
(
"context:%p, fd:%d, write body, chunkSize:%"
PRIu64
", response:
\n
%s"
,
buf
->
pContext
,
buf
->
pContext
->
fd
,
srcLen
,
buf
->
buf
);
srcLen
,
buf
->
buf
);
httpWriteBufNoTrace
(
buf
->
pContext
,
sLen
,
len
);
httpWriteBufNoTrace
(
buf
->
pContext
,
sLen
,
len
);
...
@@ -267,9 +267,9 @@ void httpJsonTimestamp(JsonBuf* buf, int64_t t, bool us) {
...
@@ -267,9 +267,9 @@ void httpJsonTimestamp(JsonBuf* buf, int64_t t, bool us) {
ptm
=
localtime
(
&
tt
);
ptm
=
localtime
(
&
tt
);
int32_t
length
=
(
int32_t
)
strftime
(
ts
,
35
,
"%Y-%m-%d %H:%M:%S"
,
ptm
);
int32_t
length
=
(
int32_t
)
strftime
(
ts
,
35
,
"%Y-%m-%d %H:%M:%S"
,
ptm
);
if
(
us
)
{
if
(
us
)
{
length
+=
snprintf
(
ts
+
length
,
8
,
".%06
ld"
,
t
%
precision
);
length
+=
snprintf
(
ts
+
length
,
8
,
".%06
"
PRId64
,
t
%
precision
);
}
else
{
}
else
{
length
+=
snprintf
(
ts
+
length
,
5
,
".%03
ld"
,
t
%
precision
);
length
+=
snprintf
(
ts
+
length
,
5
,
".%03
"
PRId64
,
t
%
precision
);
}
}
httpJsonString
(
buf
,
ts
,
length
);
httpJsonString
(
buf
,
ts
,
length
);
...
@@ -287,9 +287,9 @@ void httpJsonUtcTimestamp(JsonBuf* buf, int64_t t, bool us) {
...
@@ -287,9 +287,9 @@ void httpJsonUtcTimestamp(JsonBuf* buf, int64_t t, bool us) {
ptm
=
localtime
(
&
tt
);
ptm
=
localtime
(
&
tt
);
int32_t
length
=
(
int32_t
)
strftime
(
ts
,
40
,
"%Y-%m-%dT%H:%M:%S"
,
ptm
);
int32_t
length
=
(
int32_t
)
strftime
(
ts
,
40
,
"%Y-%m-%dT%H:%M:%S"
,
ptm
);
if
(
us
)
{
if
(
us
)
{
length
+=
snprintf
(
ts
+
length
,
8
,
".%06
ld"
,
t
%
precision
);
length
+=
snprintf
(
ts
+
length
,
8
,
".%06
"
PRId64
,
t
%
precision
);
}
else
{
}
else
{
length
+=
snprintf
(
ts
+
length
,
5
,
".%03
ld"
,
t
%
precision
);
length
+=
snprintf
(
ts
+
length
,
5
,
".%03
"
PRId64
,
t
%
precision
);
}
}
length
+=
(
int32_t
)
strftime
(
ts
+
length
,
40
-
length
,
"%z"
,
ptm
);
length
+=
(
int32_t
)
strftime
(
ts
+
length
,
40
-
length
,
"%z"
,
ptm
);
...
...
src/sync/src/syncRetrieve.c
浏览文件 @
e32e507e
...
@@ -325,7 +325,7 @@ static int syncProcessLastWal(SSyncPeer *pPeer, char *wname, uint32_t index) {
...
@@ -325,7 +325,7 @@ static int syncProcessLastWal(SSyncPeer *pPeer, char *wname, uint32_t index) {
// if all data up to fversion is read out, it is over
// if all data up to fversion is read out, it is over
if
(
pPeer
->
sversion
>=
fversion
&&
fversion
>
0
)
{
if
(
pPeer
->
sversion
>=
fversion
&&
fversion
>
0
)
{
code
=
0
;
code
=
0
;
sDebug
(
"%s, data up to fversion:%
ld
has been read out, bytes:%d"
,
pPeer
->
id
,
fversion
,
bytes
);
sDebug
(
"%s, data up to fversion:%
"
PRId64
"
has been read out, bytes:%d"
,
pPeer
->
id
,
fversion
,
bytes
);
break
;
break
;
}
}
...
...
src/sync/test/syncServer.c
浏览文件 @
e32e507e
...
@@ -386,7 +386,7 @@ int main(int argc, char *argv[]) {
...
@@ -386,7 +386,7 @@ int main(int argc, char *argv[]) {
printf
(
" [-m msgSize]: message body size, default is:%d
\n
"
,
msgSize
);
printf
(
" [-m msgSize]: message body size, default is:%d
\n
"
,
msgSize
);
printf
(
" [-o compSize]: compression message size, default is:%d
\n
"
,
tsCompressMsgSize
);
printf
(
" [-o compSize]: compression message size, default is:%d
\n
"
,
tsCompressMsgSize
);
printf
(
" [-w write]: write received data to file(0, 1, 2), default is:%d
\n
"
,
commit
);
printf
(
" [-w write]: write received data to file(0, 1, 2), default is:%d
\n
"
,
commit
);
printf
(
" [-v version]: initial node version, default is:%
ld
\n
"
,
syncInfo
.
version
);
printf
(
" [-v version]: initial node version, default is:%
"
PRId64
"
\n
"
,
syncInfo
.
version
);
printf
(
" [-r replica]: replicacation number, default is:%d
\n
"
,
pCfg
->
replica
);
printf
(
" [-r replica]: replicacation number, default is:%d
\n
"
,
pCfg
->
replica
);
printf
(
" [-q quorum]: quorum, default is:%d
\n
"
,
pCfg
->
quorum
);
printf
(
" [-q quorum]: quorum, default is:%d
\n
"
,
pCfg
->
quorum
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
rpcDebugFlag
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
rpcDebugFlag
);
...
...
src/wal/test/waltest.c
浏览文件 @
e32e507e
...
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
...
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
printf
(
" [-t total]: total wal files, default is:%d
\n
"
,
total
);
printf
(
" [-t total]: total wal files, default is:%d
\n
"
,
total
);
printf
(
" [-r rows]: rows of records per wal file, default is:%d
\n
"
,
rows
);
printf
(
" [-r rows]: rows of records per wal file, default is:%d
\n
"
,
rows
);
printf
(
" [-k keep]: keep the wal after closing, default is:%d
\n
"
,
keep
);
printf
(
" [-k keep]: keep the wal after closing, default is:%d
\n
"
,
keep
);
printf
(
" [-v version]: initial version, default is:%
ld
\n
"
,
ver
);
printf
(
" [-v version]: initial version, default is:%
"
PRId64
"
\n
"
,
ver
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
dDebugFlag
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
dDebugFlag
);
printf
(
" [-h help]: print out this help
\n\n
"
);
printf
(
" [-h help]: print out this help
\n\n
"
);
exit
(
0
);
exit
(
0
);
...
@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
...
@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
exit
(
-
1
);
exit
(
-
1
);
}
}
printf
(
"version starts from:%
ld
\n
"
,
ver
);
printf
(
"version starts from:%
"
PRId64
"
\n
"
,
ver
);
int
contLen
=
sizeof
(
SWalHead
)
+
size
;
int
contLen
=
sizeof
(
SWalHead
)
+
size
;
SWalHead
*
pHead
=
(
SWalHead
*
)
malloc
(
contLen
);
SWalHead
*
pHead
=
(
SWalHead
*
)
malloc
(
contLen
);
...
...
tests/comparisonTest/tdengine/tdengineTest.c
浏览文件 @
e32e507e
...
@@ -278,7 +278,7 @@ void writeData() {
...
@@ -278,7 +278,7 @@ void writeData() {
free
(
threads
);
free
(
threads
);
printf
(
"---- Spent %f seconds to insert %
ld
records, speed: %f Rows/Second
\n
"
,
seconds
,
statis
.
totalRows
,
rs
);
printf
(
"---- Spent %f seconds to insert %
"
PRId64
"
records, speed: %f Rows/Second
\n
"
,
seconds
,
statis
.
totalRows
,
rs
);
}
}
void
readDataImp
(
void
*
param
)
void
readDataImp
(
void
*
param
)
...
...
tests/examples/c/demo.c
浏览文件 @
e32e507e
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <inttypes.h>
#include <taos.h> // TAOS header file
#include <taos.h> // TAOS header file
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
...
@@ -67,7 +68,7 @@ int main(int argc, char *argv[]) {
...
@@ -67,7 +68,7 @@ int main(int argc, char *argv[]) {
// insert 10 records
// insert 10 records
int
i
=
0
;
int
i
=
0
;
for
(
i
=
0
;
i
<
10
;
++
i
)
{
for
(
i
=
0
;
i
<
10
;
++
i
)
{
sprintf
(
qstr
,
"insert into m1 values (%
ld
, %d, %d, %d, %d, %f, %lf, '%s')"
,
1546300800000
+
i
*
1000
,
i
,
i
,
i
,
i
*
10000000
,
i
*
1
.
0
,
i
*
2
.
0
,
"hello"
);
sprintf
(
qstr
,
"insert into m1 values (%
"
PRId64
"
, %d, %d, %d, %d, %f, %lf, '%s')"
,
1546300800000
+
i
*
1000
,
i
,
i
,
i
,
i
*
10000000
,
i
*
1
.
0
,
i
*
2
.
0
,
"hello"
);
printf
(
"qstr: %s
\n
"
,
qstr
);
printf
(
"qstr: %s
\n
"
,
qstr
);
if
(
taos_query
(
taos
,
qstr
))
{
if
(
taos_query
(
taos
,
qstr
))
{
printf
(
"insert row: %i, reason:%s
\n
"
,
i
,
taos_errstr
(
taos
));
printf
(
"insert row: %i, reason:%s
\n
"
,
i
,
taos_errstr
(
taos
));
...
...
tests/tsim/src/simExe.c
浏览文件 @
e32e507e
...
@@ -751,7 +751,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
...
@@ -751,7 +751,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
sprintf
(
value
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
sprintf
(
value
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:{
case
TSDB_DATA_TYPE_FLOAT
:{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
float
fv
=
0
;
float
fv
=
0
;
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
row
[
i
];
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
row
[
i
];
sprintf
(
value
,
"%.5f"
,
fv
);
sprintf
(
value
,
"%.5f"
,
fv
);
...
@@ -761,7 +761,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
...
@@ -761,7 +761,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
}
}
break
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32
_
#ifdef _TD_ARM_32
double
dv
=
0
;
double
dv
=
0
;
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
row
[
i
];
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
row
[
i
];
sprintf
(
value
,
"%.9lf"
,
dv
);
sprintf
(
value
,
"%.9lf"
,
dv
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录