Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1792bf5f
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看板
提交
1792bf5f
编写于
5月 07, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
8dd7c076
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
148 addition
and
12 deletion
+148
-12
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+1
-0
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+12
-4
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+1
-1
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+16
-0
source/libs/scalar/src/sclvector.c
source/libs/scalar/src/sclvector.c
+113
-4
source/util/src/terror.c
source/util/src/terror.c
+1
-0
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+3
-3
未找到文件。
include/util/taoserror.h
浏览文件 @
1792bf5f
...
...
@@ -88,6 +88,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_CFG_NOT_FOUND TAOS_DEF_ERROR_CODE(0, 0x0114)
#define TSDB_CODE_REPEAT_INIT TAOS_DEF_ERROR_CODE(0, 0x0115)
#define TSDB_CODE_DUP_KEY TAOS_DEF_ERROR_CODE(0, 0x0116)
#define TSDB_CODE_NEED_RETRY TAOS_DEF_ERROR_CODE(0, 0x0117)
#define TSDB_CODE_REF_NO_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0140)
#define TSDB_CODE_REF_FULL TAOS_DEF_ERROR_CODE(0, 0x0141)
...
...
source/client/inc/clientInt.h
浏览文件 @
1792bf5f
...
...
@@ -310,6 +310,7 @@ void hbMgrInitMqHbRspHandle();
SRequestObj
*
launchQueryImpl
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
int32_t
code
,
bool
keepQuery
);
int32_t
getQueryPlan
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
SArray
**
pNodeList
);
int32_t
scheduleQuery
(
SRequestObj
*
pRequest
,
SQueryPlan
*
pDag
,
SArray
*
pNodeList
);
int32_t
refreshMeta
(
STscObj
*
pTscObj
,
SRequestObj
*
pRequest
);
#ifdef __cplusplus
}
...
...
source/client/src/clientStmt.c
浏览文件 @
1792bf5f
...
...
@@ -586,6 +586,16 @@ int stmtExec(TAOS_STMT *stmt) {
STMT_ERR_RET
(
qBuildStmtOutput
(
pStmt
->
sql
.
pQuery
,
pStmt
->
exec
.
pVgHash
,
pStmt
->
exec
.
pBlockHash
));
launchQueryImpl
(
pStmt
->
exec
.
pRequest
,
pStmt
->
sql
.
pQuery
,
TSDB_CODE_SUCCESS
,
true
);
}
if
(
pStmt
->
exec
.
pRequest
->
code
&&
NEED_CLIENT_HANDLE_ERROR
(
pStmt
->
exec
.
pRequest
->
code
))
{
code
=
refreshMeta
(
pStmt
->
exec
.
pRequest
->
pTscObj
,
pStmt
->
exec
.
pRequest
);
if
(
code
)
{
pStmt
->
exec
.
pRequest
->
code
=
code
;
}
else
{
STMT_ERR_RET
(
stmtResetStmt
(
pStmt
));
STMT_ERR_RET
(
TSDB_CODE_NEED_RETRY
);
}
}
STMT_ERR_JRET
(
pStmt
->
exec
.
pRequest
->
code
);
...
...
@@ -613,13 +623,11 @@ int stmtClose(TAOS_STMT *stmt) {
const
char
*
stmtErrstr
(
TAOS_STMT
*
stmt
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
if
(
stmt
==
NULL
)
{
if
(
stmt
==
NULL
||
NULL
==
pStmt
->
exec
.
pRequest
)
{
return
(
char
*
)
tstrerror
(
terrno
);
}
if
(
pStmt
->
exec
.
pRequest
)
{
pStmt
->
exec
.
pRequest
->
code
=
terrno
;
}
pStmt
->
exec
.
pRequest
->
code
=
terrno
;
return
taos_errstr
(
pStmt
->
exec
.
pRequest
);
}
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
1792bf5f
...
...
@@ -537,7 +537,7 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in
goto
_exit
;
}
rsp
.
numOf
Rows
+=
nRows
;
rsp
.
affected
Rows
+=
nRows
;
}
_exit:
...
...
source/libs/scalar/src/filter.c
浏览文件 @
1792bf5f
...
...
@@ -3577,6 +3577,22 @@ EDealRes fltReviseRewriter(SNode** pNode, void* pContext) {
}
if
(
QUERY_NODE_NODE_LIST
==
nodeType
(
*
pNode
))
{
SNodeListNode
*
listNode
=
(
SNodeListNode
*
)
*
pNode
;
if
(
QUERY_NODE_VALUE
!=
nodeType
(
listNode
->
pNodeList
->
pHead
->
pNode
))
{
stat
->
scalarMode
=
true
;
return
DEAL_RES_CONTINUE
;
}
SValueNode
*
valueNode
=
(
SValueNode
*
)
listNode
->
pNodeList
->
pHead
->
pNode
;
uint8_t
type
=
valueNode
->
node
.
resType
.
type
;
SNode
*
node
=
NULL
;
FOREACH
(
node
,
listNode
->
pNodeList
)
{
if
(
type
!=
((
SValueNode
*
)
node
)
->
node
.
resType
.
type
)
{
stat
->
scalarMode
=
true
;
return
DEAL_RES_CONTINUE
;
}
}
return
DEAL_RES_CONTINUE
;
}
...
...
source/libs/scalar/src/sclvector.c
浏览文件 @
1792bf5f
...
...
@@ -265,13 +265,53 @@ static FORCE_INLINE void varToTimestamp(char *buf, SScalarParam* pOut, int32_t r
}
static
FORCE_INLINE
void
varToSigned
(
char
*
buf
,
SScalarParam
*
pOut
,
int32_t
rowIndex
)
{
int64_t
value
=
strtoll
(
buf
,
NULL
,
10
);
colDataAppendInt64
(
pOut
->
columnData
,
rowIndex
,
&
value
);
switch
(
pOut
->
columnData
->
info
.
type
)
{
case
TSDB_DATA_TYPE_TINYINT
:
{
int8_t
value
=
(
int8_t
)
strtoll
(
buf
,
NULL
,
10
);
colDataAppendInt8
(
pOut
->
columnData
,
rowIndex
,
(
int8_t
*
)
&
value
);
break
;
}
case
TSDB_DATA_TYPE_SMALLINT
:
{
int16_t
value
=
(
int16_t
)
strtoll
(
buf
,
NULL
,
10
);
colDataAppendInt16
(
pOut
->
columnData
,
rowIndex
,
(
int16_t
*
)
&
value
);
break
;
}
case
TSDB_DATA_TYPE_INT
:
{
int32_t
value
=
(
int32_t
)
strtoll
(
buf
,
NULL
,
10
);
colDataAppendInt32
(
pOut
->
columnData
,
rowIndex
,
(
int32_t
*
)
&
value
);
break
;
}
case
TSDB_DATA_TYPE_BIGINT
:
{
int64_t
value
=
(
int64_t
)
strtoll
(
buf
,
NULL
,
10
);
colDataAppendInt64
(
pOut
->
columnData
,
rowIndex
,
(
int64_t
*
)
&
value
);
break
;
}
}
}
static
FORCE_INLINE
void
varToUnsigned
(
char
*
buf
,
SScalarParam
*
pOut
,
int32_t
rowIndex
)
{
uint64_t
value
=
strtoull
(
buf
,
NULL
,
10
);
colDataAppendInt64
(
pOut
->
columnData
,
rowIndex
,
(
int64_t
*
)
&
value
);
switch
(
pOut
->
columnData
->
info
.
type
)
{
case
TSDB_DATA_TYPE_UTINYINT
:
{
uint8_t
value
=
(
uint8_t
)
strtoull
(
buf
,
NULL
,
10
);
colDataAppendInt8
(
pOut
->
columnData
,
rowIndex
,
(
int8_t
*
)
&
value
);
break
;
}
case
TSDB_DATA_TYPE_USMALLINT
:
{
uint16_t
value
=
(
uint16_t
)
strtoull
(
buf
,
NULL
,
10
);
colDataAppendInt16
(
pOut
->
columnData
,
rowIndex
,
(
int16_t
*
)
&
value
);
break
;
}
case
TSDB_DATA_TYPE_UINT
:
{
uint32_t
value
=
(
uint32_t
)
strtoull
(
buf
,
NULL
,
10
);
colDataAppendInt32
(
pOut
->
columnData
,
rowIndex
,
(
int32_t
*
)
&
value
);
break
;
}
case
TSDB_DATA_TYPE_UBIGINT
:
{
uint64_t
value
=
(
uint64_t
)
strtoull
(
buf
,
NULL
,
10
);
colDataAppendInt64
(
pOut
->
columnData
,
rowIndex
,
(
int64_t
*
)
&
value
);
break
;
}
}
}
static
FORCE_INLINE
void
varToFloat
(
char
*
buf
,
SScalarParam
*
pOut
,
int32_t
rowIndex
)
{
...
...
@@ -453,6 +493,71 @@ void convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t
}
}
int32_t
vectorConvertToVarData
(
const
SScalarParam
*
pIn
,
SScalarParam
*
pOut
,
int16_t
inType
,
int16_t
outType
)
{
SColumnInfoData
*
pInputCol
=
pIn
->
columnData
;
SColumnInfoData
*
pOutputCol
=
pOut
->
columnData
;
char
tmp
[
128
]
=
{
0
};
if
(
IS_SIGNED_NUMERIC_TYPE
(
inType
)
||
inType
==
TSDB_DATA_TYPE_BOOL
||
inType
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
for
(
int32_t
i
=
0
;
i
<
pIn
->
numOfRows
;
++
i
)
{
if
(
colDataIsNull_f
(
pInputCol
->
nullbitmap
,
i
))
{
colDataAppendNULL
(
pOutputCol
,
i
);
continue
;
}
int64_t
value
=
0
;
GET_TYPED_DATA
(
value
,
int64_t
,
inType
,
colDataGetData
(
pInputCol
,
i
));
int32_t
len
=
sprintf
(
varDataVal
(
tmp
),
"%"
PRId64
,
value
);
varDataLen
(
tmp
)
=
len
;
if
(
outType
==
TSDB_DATA_TYPE_NCHAR
)
{
varToNchar
(
tmp
,
pOut
,
i
);
}
else
{
colDataAppend
(
pOutputCol
,
i
,
(
char
*
)
&
value
,
false
);
}
}
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
inType
))
{
for
(
int32_t
i
=
0
;
i
<
pIn
->
numOfRows
;
++
i
)
{
if
(
colDataIsNull_f
(
pInputCol
->
nullbitmap
,
i
))
{
colDataAppendNULL
(
pOutputCol
,
i
);
continue
;
}
uint64_t
value
=
0
;
GET_TYPED_DATA
(
value
,
uint64_t
,
inType
,
colDataGetData
(
pInputCol
,
i
));
int32_t
len
=
sprintf
(
varDataVal
(
tmp
),
"%"
PRIu64
,
value
);
varDataLen
(
tmp
)
=
len
;
if
(
outType
==
TSDB_DATA_TYPE_NCHAR
)
{
varToNchar
(
tmp
,
pOut
,
i
);
}
else
{
colDataAppend
(
pOutputCol
,
i
,
(
char
*
)
&
value
,
false
);
}
}
}
else
if
(
IS_FLOAT_TYPE
(
inType
))
{
for
(
int32_t
i
=
0
;
i
<
pIn
->
numOfRows
;
++
i
)
{
if
(
colDataIsNull_f
(
pInputCol
->
nullbitmap
,
i
))
{
colDataAppendNULL
(
pOutputCol
,
i
);
continue
;
}
double
value
=
0
;
GET_TYPED_DATA
(
value
,
double
,
inType
,
colDataGetData
(
pInputCol
,
i
));
int32_t
len
=
sprintf
(
varDataVal
(
tmp
),
"%lf"
,
value
);
varDataLen
(
tmp
)
=
len
;
if
(
outType
==
TSDB_DATA_TYPE_NCHAR
)
{
varToNchar
(
tmp
,
pOut
,
i
);
}
else
{
colDataAppend
(
pOutputCol
,
i
,
(
char
*
)
&
value
,
false
);
}
}
}
else
{
sclError
(
"not supported input type:%d"
,
inType
);
return
TSDB_CODE_QRY_APP_ERROR
;
}
return
TSDB_CODE_SUCCESS
;
}
// TODO opt performance
int32_t
vectorConvertImpl
(
const
SScalarParam
*
pIn
,
SScalarParam
*
pOut
)
{
SColumnInfoData
*
pInputCol
=
pIn
->
columnData
;
...
...
@@ -610,6 +715,10 @@ int32_t vectorConvertImpl(const SScalarParam* pIn, SScalarParam* pOut) {
}
break
;
}
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
{
return
vectorConvertToVarData
(
pIn
,
pOut
,
inType
,
outType
);
}
default:
sclError
(
"invalid convert output type:%d"
,
outType
);
return
TSDB_CODE_QRY_APP_ERROR
;
...
...
source/util/src/terror.c
浏览文件 @
1792bf5f
...
...
@@ -94,6 +94,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MSG_NOT_PROCESSED, "Message not processed
TAOS_DEFINE_ERROR
(
TSDB_CODE_CFG_NOT_FOUND
,
"Config not found"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_REPEAT_INIT
,
"Repeat initialization"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DUP_KEY
,
"Cannot add duplicate keys to hash"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NEED_RETRY
,
"Retry needed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_REF_NO_MEMORY
,
"Ref out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_REF_FULL
,
"too many Ref Objs"
)
...
...
tests/script/api/batchprepare.c
浏览文件 @
1792bf5f
...
...
@@ -11,7 +11,7 @@
int32_t
shortColList
[]
=
{
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_DATA_TYPE_INT
};
int32_t
fullColList
[]
=
{
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_DATA_TYPE_BOOL
,
TSDB_DATA_TYPE_TINYINT
,
TSDB_DATA_TYPE_UTINYINT
,
TSDB_DATA_TYPE_SMALLINT
,
TSDB_DATA_TYPE_USMALLINT
,
TSDB_DATA_TYPE_INT
,
TSDB_DATA_TYPE_UINT
,
TSDB_DATA_TYPE_BIGINT
,
TSDB_DATA_TYPE_UBIGINT
,
TSDB_DATA_TYPE_FLOAT
,
TSDB_DATA_TYPE_DOUBLE
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DATA_TYPE_NCHAR
};
int32_t
bindColTypeList
[]
=
{
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_DATA_TYPE_SMALLINT
,
TSDB_DATA_TYPE_
DOUBLE
};
int32_t
bindColTypeList
[]
=
{
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_DATA_TYPE_SMALLINT
,
TSDB_DATA_TYPE_
NCHAR
};
int32_t
optrIdxList
[]
=
{
0
,
1
,
2
};
typedef
struct
{
...
...
@@ -235,7 +235,7 @@ CaseCtrl gCaseCtrl = { // query case with specified col&oper
.
bindColTypeList
=
NULL
,
.
optrIdxListNum
=
0
,
.
optrIdxList
=
NULL
,
.
checkParamNum
=
tru
e
,
.
checkParamNum
=
fals
e
,
.
printRes
=
true
,
.
runTimes
=
0
,
.
caseRunIdx
=
-
1
,
...
...
@@ -795,7 +795,7 @@ int32_t prepareQueryCondData(BindData *data, int32_t tblIdx) {
}
}
generateQuerySQL
(
data
,
tblIdx
);
generateQuery
Cond
SQL
(
data
,
tblIdx
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录