Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
61e27f7a
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看板
提交
61e27f7a
编写于
9月 29, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1530
上级
5f97a7b4
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
26 addition
and
19 deletion
+26
-19
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+3
-3
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+4
-4
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscSql.c
src/client/src/tscSql.c
+3
-3
src/kit/shell/src/shellEngine.c
src/kit/shell/src/shellEngine.c
+8
-8
tests/script/general/parser/first_last_query.sim
tests/script/general/parser/first_last_query.sim
+3
-0
tests/script/general/parser/where.sim
tests/script/general/parser/where.sim
+4
-0
未找到文件。
src/client/src/TSDBJNIConnector.c
浏览文件 @
61e27f7a
...
...
@@ -490,13 +490,13 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetBooleanFp
,
i
,
(
jboolean
)(
*
((
char
*
)
row
[
i
])
==
1
));
break
;
case
TSDB_DATA_TYPE_TINYINT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetByteFp
,
i
,
(
jbyte
)
*
((
char
*
)
row
[
i
]));
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetByteFp
,
i
,
(
jbyte
)
*
((
int8_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetShortFp
,
i
,
(
jshort
)
*
((
shor
t
*
)
row
[
i
]));
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetShortFp
,
i
,
(
jshort
)
*
((
int16_
t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_INT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetIntFp
,
i
,
(
jint
)
*
(
int
*
)
row
[
i
]);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetIntFp
,
i
,
(
jint
)
*
(
int
32_t
*
)
row
[
i
]);
break
;
case
TSDB_DATA_TYPE_BIGINT
:
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_rowdataSetLongFp
,
i
,
(
jlong
)
*
((
int64_t
*
)
row
[
i
]));
...
...
src/client/src/tscLocal.c
浏览文件 @
61e27f7a
...
...
@@ -306,16 +306,16 @@ static int32_t tscGetNthFieldResult(TAOS_ROW row, TAOS_FIELD* fields, int *lengt
switch
(
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
sprintf
(
result
,
"%s"
,
((((
int
)(
*
((
char
*
)
val
)))
==
1
)
?
"true"
:
"false"
));
sprintf
(
result
,
"%s"
,
((((
int
32_t
)(
*
((
char
*
)
val
)))
==
1
)
?
"true"
:
"false"
));
break
;
case
TSDB_DATA_TYPE_TINYINT
:
sprintf
(
result
,
"%d"
,
(
int
)(
*
((
char
*
)
val
)
));
sprintf
(
result
,
"%d"
,
*
((
int8_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
sprintf
(
result
,
"%d"
,
(
int
)(
*
((
short
*
)
val
)
));
sprintf
(
result
,
"%d"
,
*
((
int16_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_INT
:
sprintf
(
result
,
"%d"
,
*
((
int
*
)
val
));
sprintf
(
result
,
"%d"
,
*
((
int
32_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_BIGINT
:
sprintf
(
result
,
"%"
PRId64
,
*
((
int64_t
*
)
val
));
...
...
src/client/src/tscSQLParser.c
浏览文件 @
61e27f7a
...
...
@@ -1699,7 +1699,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
if
(
pItem
->
pNode
->
pParam
!=
NULL
)
{
tSQLExprItem
*
pParamElem
=
&
pItem
->
pNode
->
pParam
->
a
[
0
];
SStrToken
*
pToken
=
&
pParamElem
->
pNode
->
colInfo
;
shor
t
sqlOptr
=
pParamElem
->
pNode
->
nSQLOptr
;
int16_
t
sqlOptr
=
pParamElem
->
pNode
->
nSQLOptr
;
if
((
pToken
->
z
==
NULL
||
pToken
->
n
==
0
)
&&
(
TK_INTEGER
!=
sqlOptr
))
/*select count(1) from table*/
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
...
...
src/client/src/tscSql.c
浏览文件 @
61e27f7a
...
...
@@ -719,15 +719,15 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
switch
(
fields
[
i
].
type
)
{
case
TSDB_DATA_TYPE_TINYINT
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
char
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int8_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
shor
t
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int16_
t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_INT
:
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int
*
)
row
[
i
]));
len
+=
sprintf
(
str
+
len
,
"%d"
,
*
((
int
32_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_BIGINT
:
...
...
src/kit/shell/src/shellEngine.c
浏览文件 @
61e27f7a
...
...
@@ -419,16 +419,16 @@ static void dumpFieldToFile(FILE* fp, const char* val, TAOS_FIELD* field, int32_
char
buf
[
TSDB_MAX_BYTES_PER_ROW
];
switch
(
field
->
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
fprintf
(
fp
,
"%d"
,
((((
int
)(
*
((
char
*
)
val
)))
==
1
)
?
1
:
0
));
fprintf
(
fp
,
"%d"
,
((((
int
32_t
)(
*
((
char
*
)
val
)))
==
1
)
?
1
:
0
));
break
;
case
TSDB_DATA_TYPE_TINYINT
:
fprintf
(
fp
,
"%d"
,
(
int
)(
*
((
char
*
)
val
)
));
fprintf
(
fp
,
"%d"
,
*
((
int8_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
fprintf
(
fp
,
"%d"
,
(
int
)(
*
((
short
*
)
val
)
));
fprintf
(
fp
,
"%d"
,
*
((
int16_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_INT
:
fprintf
(
fp
,
"%d"
,
*
((
int
*
)
val
));
fprintf
(
fp
,
"%d"
,
*
((
int
32_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_BIGINT
:
fprintf
(
fp
,
"%"
PRId64
,
*
((
int64_t
*
)
val
));
...
...
@@ -559,16 +559,16 @@ static void printField(const char* val, TAOS_FIELD* field, int width, int32_t le
char
buf
[
TSDB_MAX_BYTES_PER_ROW
];
switch
(
field
->
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
printf
(
"%*s"
,
width
,
((((
int
)(
*
((
char
*
)
val
)))
==
1
)
?
"true"
:
"false"
));
printf
(
"%*s"
,
width
,
((((
int
32_t
)(
*
((
char
*
)
val
)))
==
1
)
?
"true"
:
"false"
));
break
;
case
TSDB_DATA_TYPE_TINYINT
:
printf
(
"%*d"
,
width
,
(
int
)(
*
((
char
*
)
val
)
));
printf
(
"%*d"
,
width
,
*
((
int8_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
printf
(
"%*d"
,
width
,
(
int
)(
*
((
short
*
)
val
)
));
printf
(
"%*d"
,
width
,
*
((
int16_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_INT
:
printf
(
"%*d"
,
width
,
*
((
int
*
)
val
));
printf
(
"%*d"
,
width
,
*
((
int
32_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_BIGINT
:
printf
(
"%*"
PRId64
,
width
,
*
((
int64_t
*
)
val
));
...
...
tests/script/general/parser/first_last_query.sim
浏览文件 @
61e27f7a
...
...
@@ -14,12 +14,14 @@ $i = 0
$db = $dbPrefix . $i
$stb = $stbPrefix . $i
print use $db
sql use $db
##### select first/last from table
## TBASE-331
print ====== select first/last from table
$tb = $tbPrefix . 0
print select first(*) from $tb
sql select first(*) from $tb
if $rows != 1 then
return -1
...
...
@@ -58,6 +60,7 @@ if $data09 != NCHAR then
return -1
endi
print select last(*) from $tb
sql select last(*) from $tb
if $rows != 1 then
return -1
...
...
tests/script/general/parser/where.sim
浏览文件 @
61e27f7a
...
...
@@ -94,7 +94,11 @@ endi
## select specified columns
print select c1 from $mt
sql select c1 from $mt
print rows $rows
print totalNum $totalNum
if $rows != $totalNum then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录