Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e8ce5a10
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e8ce5a10
编写于
7月 02, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: code optimization
上级
06c0d990
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
27 deletion
+0
-27
tests/script/api/passwdTest.c
tests/script/api/passwdTest.c
+0
-27
未找到文件。
tests/script/api/passwdTest.c
浏览文件 @
e8ce5a10
...
@@ -113,47 +113,37 @@ int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) {
...
@@ -113,47 +113,37 @@ int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) {
case
TSDB_DATA_TYPE_TINYINT
:
case
TSDB_DATA_TYPE_TINYINT
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int8_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int8_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
case
TSDB_DATA_TYPE_UTINYINT
:
len
+=
sprintf
(
str
+
len
,
"%u"
,
*
((
uint8_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%u"
,
*
((
uint8_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
case
TSDB_DATA_TYPE_SMALLINT
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int16_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int16_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
case
TSDB_DATA_TYPE_USMALLINT
:
len
+=
sprintf
(
str
+
len
,
"%u"
,
*
((
uint16_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%u"
,
*
((
uint16_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_INT
:
case
TSDB_DATA_TYPE_INT
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int32_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int32_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_UINT
:
case
TSDB_DATA_TYPE_UINT
:
len
+=
sprintf
(
str
+
len
,
"%u"
,
*
((
uint32_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%u"
,
*
((
uint32_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_BIGINT
:
case
TSDB_DATA_TYPE_BIGINT
:
len
+=
sprintf
(
str
+
len
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_UBIGINT
:
case
TSDB_DATA_TYPE_UBIGINT
:
len
+=
sprintf
(
str
+
len
,
"%"
PRIu64
,
*
((
uint64_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%"
PRIu64
,
*
((
uint64_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
{
case
TSDB_DATA_TYPE_FLOAT
:
{
float
fv
=
0
;
float
fv
=
0
;
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
len
+=
sprintf
(
str
+
len
,
"%f"
,
fv
);
len
+=
sprintf
(
str
+
len
,
"%f"
,
fv
);
}
break
;
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
case
TSDB_DATA_TYPE_DOUBLE
:
{
double
dv
=
0
;
double
dv
=
0
;
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
len
+=
sprintf
(
str
+
len
,
"%lf"
,
dv
);
len
+=
sprintf
(
str
+
len
,
"%lf"
,
dv
);
}
break
;
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
case
TSDB_DATA_TYPE_NCHAR
:
case
TSDB_DATA_TYPE_GEOMETRY
:
{
case
TSDB_DATA_TYPE_GEOMETRY
:
{
...
@@ -161,18 +151,15 @@ int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) {
...
@@ -161,18 +151,15 @@ int printRow(char *str, TAOS_ROW row, TAOS_FIELD *fields, int numFields) {
memcpy
(
str
+
len
,
row
[
i
],
charLen
);
memcpy
(
str
+
len
,
row
[
i
],
charLen
);
len
+=
charLen
;
len
+=
charLen
;
}
break
;
}
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
case
TSDB_DATA_TYPE_TIMESTAMP
:
len
+=
sprintf
(
str
+
len
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
break
;
break
;
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_BOOL
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int8_t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int8_t
*
)
row
[
i
]));
default:
default:
break
;
break
;
}
}
}
}
return
len
;
return
len
;
}
}
...
@@ -376,20 +363,6 @@ _REP:
...
@@ -376,20 +363,6 @@ _REP:
sleep
(
1
);
sleep
(
1
);
}
}
res
=
taos_query
(
taos
[
0
],
qstr
);
int32_t
code
=
taos_errno
(
res
);
if
(
code
!=
0
)
{
fprintf
(
stderr
,
"%s:%d failed to execute: %s since %s
\n
"
,
__func__
,
__LINE__
,
qstr
,
taos_errstr
(
res
));
taos_free_result
(
res
);
exit
(
EXIT_FAILURE
);
}
printResult
(
res
,
output
);
taos_free_result
(
res
);
if
(
!
strstr
(
output
,
"timeseries"
))
{
fprintf
(
stderr
,
"%s:%d expected output: 'timeseries' not occur
\n
"
,
__func__
,
__LINE__
);
exit
(
EXIT_FAILURE
);
}
if
(
++
nRep
<
5
)
{
if
(
++
nRep
<
5
)
{
goto
_REP
;
goto
_REP
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录