Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ca6a7ba3
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看板
提交
ca6a7ba3
编写于
12月 23, 2019
作者:
L
lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-816]
上级
3e1f3df3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
47 addition
and
75 deletion
+47
-75
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+20
-8
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+5
-21
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+2
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscSql.c
src/client/src/tscSql.c
+10
-4
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+9
-39
未找到文件。
src/client/src/TSDBJNIConnector.c
浏览文件 @
ca6a7ba3
...
...
@@ -466,11 +466,17 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
case
TSDB_DATA_TYPE_BIGINT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetLongFp
,
i
,
(
jlong
)
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetFloatFp
,
i
,
(
jfloat
)
*
((
float
*
)
row
[
i
]));
case
TSDB_DATA_TYPE_FLOAT
:
{
float
fv
=
0
;
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetFloatFp
,
i
,
(
jfloat
)
fv
);
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetDoubleFp
,
i
,
(
jdouble
)
*
((
double
*
)
row
[
i
]));
case
TSDB_DATA_TYPE_DOUBLE
:
{
double
dv
=
0
;
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetDoubleFp
,
i
,
(
jdouble
)
dv
);
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
{
strncpy
(
tmp
,
row
[
i
],
(
size_t
)
fields
[
i
].
bytes
);
// handle the case that terminated does not exist
...
...
@@ -615,11 +621,17 @@ JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_consumeImp(JNI
case
TSDB_DATA_TYPE_BIGINT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetLongFp
,
i
,
(
jlong
)
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetFloatFp
,
i
,
(
jfloat
)
*
((
float
*
)
row
[
i
]));
case
TSDB_DATA_TYPE_FLOAT
:
{
float
fv
=
0
;
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetFloatFp
,
i
,
(
jfloat
)
fv
);
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetDoubleFp
,
i
,
(
jdouble
)
*
((
double
*
)
row
[
i
]));
case
TSDB_DATA_TYPE_DOUBLE
:{
double
dv
=
0
;
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetDoubleFp
,
i
,
(
jdouble
)
dv
);
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
{
strncpy
(
tmp
,
row
[
i
],
(
size_t
)
fields
[
i
].
bytes
);
// handle the case that terminated does not exist
...
...
src/client/src/tscLocal.c
浏览文件 @
ca6a7ba3
...
...
@@ -39,25 +39,17 @@ static int32_t getToStringLength(const char *pData, int32_t length, int32_t type
case
TSDB_DATA_TYPE_NCHAR
:
return
length
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32_
double
dv
=
0
;
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
pData
;
len
=
sprintf
(
buf
,
"%f"
,
dv
);
#else
len
=
sprintf
(
buf
,
"%lf"
,
*
(
double
*
)
pData
);
#endif
dv
=
GET_DOUBLE_VAL
(
pData
);
len
=
sprintf
(
buf
,
"%lf"
,
dv
);
if
(
strncasecmp
(
"nan"
,
buf
,
3
)
==
0
)
{
len
=
4
;
}
}
break
;
case
TSDB_DATA_TYPE_FLOAT
:
{
#ifdef _TD_ARM_32_
float
fv
=
0
;
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
pData
;
fv
=
GET_FLOAT_VAL
(
pData
)
;
len
=
sprintf
(
buf
,
"%f"
,
fv
);
#else
len
=
sprintf
(
buf
,
"%f"
,
*
(
float
*
)
pData
);
#endif
if
(
strncasecmp
(
"nan"
,
buf
,
3
)
==
0
)
{
len
=
4
;
}
...
...
@@ -201,22 +193,14 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
taosUcs4ToMbs
(
pTagValue
,
pSchema
[
i
].
bytes
,
target
);
break
;
case
TSDB_DATA_TYPE_FLOAT
:
{
#ifdef _TD_ARM_32_
float
fv
=
0
;
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
pTagValue
;
fv
=
GET_FLOAT_VAL
(
pTagValue
)
;
sprintf
(
target
,
"%f"
,
fv
);
#else
sprintf
(
target
,
"%f"
,
*
(
float
*
)
pTagValue
);
#endif
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32_
double
dv
=
0
;
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
pTagValue
;
dv
=
GET_DOUBLE_VAL
(
pTagValue
)
;
sprintf
(
target
,
"%lf"
,
dv
);
#else
sprintf
(
target
,
"%lf"
,
*
(
double
*
)
pTagValue
);
#endif
}
break
;
case
TSDB_DATA_TYPE_TINYINT
:
sprintf
(
target
,
"%d"
,
*
(
int8_t
*
)
pTagValue
);
...
...
src/client/src/tscPrepare.c
浏览文件 @
ca6a7ba3
...
...
@@ -121,11 +121,11 @@ static int normalStmtBindParam(STscStmt* stmt, TAOS_BIND* bind) {
break
;
case
TSDB_DATA_TYPE_FLOAT
:
var
->
dKey
=
*
(
float
*
)
tb
->
buffer
;
var
->
dKey
=
GET_FLOAT_VAL
(
tb
->
buffer
)
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
var
->
dKey
=
*
(
double
*
)
tb
->
buffer
;
var
->
dKey
=
GET_DOUBLE_VAL
(
tb
->
buffer
)
;
break
;
case
TSDB_DATA_TYPE_BINARY
:
...
...
src/client/src/tscSQLParser.c
浏览文件 @
ca6a7ba3
...
...
@@ -2165,7 +2165,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, int32_t colIdx, tSQLExprItem* pItem
if
(
optr
==
TK_PERCENTILE
||
optr
==
TK_APERCENTILE
)
{
tVariantDump
(
pVariant
,
val
,
TSDB_DATA_TYPE_DOUBLE
);
double
dp
=
*
((
double
*
)
val
);
double
dp
=
GET_DOUBLE_VAL
(
val
);
if
(
dp
<
0
||
dp
>
TOP_BOTTOM_QUERY_LIMIT
)
{
return
invalidSqlErrMsg
(
pCmd
,
msg5
);
}
...
...
src/client/src/tscSql.c
浏览文件 @
ca6a7ba3
...
...
@@ -887,12 +887,18 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
len
+=
sprintf
(
str
+
len
,
"%"
PRId64
" "
,
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
len
+=
sprintf
(
str
+
len
,
"%f "
,
*
((
float
*
)
row
[
i
]));
case
TSDB_DATA_TYPE_FLOAT
:
{
float
fv
=
0
;
fv
=
GET_FLOAT_VAL
(
row
[
i
])
len
+=
sprintf
(
str
+
len
,
"%f "
,
fv
);
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
len
+=
sprintf
(
str
+
len
,
"%lf "
,
*
((
double
*
)
row
[
i
]));
case
TSDB_DATA_TYPE_DOUBLE
:{
double
dv
=
0
;
dv
=
GET_DOUBLE_VAL
(
row
[
i
])
len
+=
sprintf
(
str
+
len
,
"%lf "
,
dv
);
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
ca6a7ba3
...
...
@@ -457,25 +457,15 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
printf
(
"%*"
PRId64
"|"
,
l
[
i
],
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
{
#ifdef _TD_ARM_32_
float
fv
=
0
;
//memcpy(&fv, row[i], sizeof(float));
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
row
[
i
];
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
printf
(
"%*.5f|"
,
l
[
i
],
fv
);
#else
printf
(
"%*.5f|"
,
l
[
i
],
*
((
float
*
)
row
[
i
]));
#endif
}
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32_
double
dv
=
0
;
//memcpy(&dv, row[i], sizeof(double));
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
row
[
i
];
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
printf
(
"%*.9f|"
,
l
[
i
],
dv
);
#else
printf
(
"%*.9f|"
,
l
[
i
],
*
((
double
*
)
row
[
i
]));
#endif
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
...
...
@@ -542,25 +532,15 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
printf
(
"%"
PRId64
"
\n
"
,
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
{
#ifdef _TD_ARM_32_
float
fv
=
0
;
//memcpy(&fv, row[i], sizeof(float));
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
row
[
i
];
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
printf
(
"%.5f
\n
"
,
fv
);
#else
printf
(
"%.5f
\n
"
,
*
((
float
*
)
row
[
i
]));
#endif
}
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32_
double
dv
=
0
;
//memcpy(&dv, row[i], sizeof(double));
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
row
[
i
];
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
printf
(
"%.9f
\n
"
,
dv
);
#else
printf
(
"%.9f
\n
"
,
*
((
double
*
)
row
[
i
]));
#endif
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
...
...
@@ -630,25 +610,15 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
fprintf
(
fp
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
{
#ifdef _TD_ARM_32_
float
fv
=
0
;
//memcpy(&fv, row[i], sizeof(float));
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)
row
[
i
];
fv
=
GET_FLOAT_VAL
(
row
[
i
]);
fprintf
(
fp
,
"%.5f"
,
fv
);
#else
fprintf
(
fp
,
"%.5f"
,
*
((
float
*
)
row
[
i
]));
#endif
}
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
#ifdef _TD_ARM_32_
double
dv
=
0
;
//memcpy(&dv, row[i], sizeof(double));
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)
row
[
i
];
dv
=
GET_DOUBLE_VAL
(
row
[
i
]);
fprintf
(
fp
,
"%.9f"
,
dv
);
#else
fprintf
(
fp
,
"%.9f"
,
*
((
double
*
)
row
[
i
]));
#endif
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录