Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
903ecc5a
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
903ecc5a
编写于
6月 09, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into feat/row_refact
上级
7a559aec
4f716560
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
149 addition
and
69 deletion
+149
-69
source/client/src/clientSml.c
source/client/src/clientSml.c
+34
-19
source/client/test/smlTest.cpp
source/client/test/smlTest.cpp
+54
-2
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+19
-5
source/common/test/dataformatTest.cpp
source/common/test/dataformatTest.cpp
+41
-43
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-0
未找到文件。
source/client/src/clientSml.c
浏览文件 @
903ecc5a
...
@@ -303,7 +303,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
...
@@ -303,7 +303,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
}
}
taos_free_result
(
res2
);
taos_free_result
(
res2
);
taosMsleep
(
50
0
);
taosMsleep
(
1
0
);
}
}
break
;
break
;
}
}
...
@@ -327,7 +327,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
...
@@ -327,7 +327,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
}
}
taos_free_result
(
res2
);
taos_free_result
(
res2
);
taosMsleep
(
50
0
);
taosMsleep
(
1
0
);
}
}
break
;
break
;
}
}
...
@@ -350,7 +350,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
...
@@ -350,7 +350,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
}
}
taos_free_result
(
res2
);
taos_free_result
(
res2
);
taosMsleep
(
50
0
);
taosMsleep
(
1
0
);
}
}
break
;
break
;
}
}
...
@@ -373,7 +373,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
...
@@ -373,7 +373,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
}
}
taos_free_result
(
res2
);
taos_free_result
(
res2
);
taosMsleep
(
50
0
);
taosMsleep
(
1
0
);
}
}
break
;
break
;
}
}
...
@@ -424,7 +424,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
...
@@ -424,7 +424,7 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
uError
(
"SML:0x%"
PRIx64
" apply schema action. reset query cache. error: %s"
,
info
->
id
,
taos_errstr
(
res2
));
}
}
taos_free_result
(
res2
);
taos_free_result
(
res2
);
taosMsleep
(
50
0
);
taosMsleep
(
1
0
);
}
}
break
;
break
;
}
}
...
@@ -461,18 +461,18 @@ static int32_t smlProcessSchemaAction(SSmlHandle* info, SSchema* schemaField, SH
...
@@ -461,18 +461,18 @@ static int32_t smlProcessSchemaAction(SSmlHandle* info, SSchema* schemaField, SH
static
int32_t
smlModifyDBSchemas
(
SSmlHandle
*
info
)
{
static
int32_t
smlModifyDBSchemas
(
SSmlHandle
*
info
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
SEpSet
ep
=
getEpSet_s
(
&
info
->
taos
->
pAppInfo
->
mgmtEp
);
SName
pName
=
{
TSDB_TABLE_NAME_T
,
info
->
taos
->
acctId
,
{
0
},
{
0
}};
strcpy
(
pName
.
dbname
,
info
->
pRequest
->
pDb
);
SSmlSTableMeta
**
tableMetaSml
=
(
SSmlSTableMeta
**
)
taosHashIterate
(
info
->
superTables
,
NULL
);
SSmlSTableMeta
**
tableMetaSml
=
(
SSmlSTableMeta
**
)
taosHashIterate
(
info
->
superTables
,
NULL
);
while
(
tableMetaSml
)
{
while
(
tableMetaSml
)
{
SSmlSTableMeta
*
sTableData
=
*
tableMetaSml
;
SSmlSTableMeta
*
sTableData
=
*
tableMetaSml
;
STableMeta
*
pTableMeta
=
NULL
;
STableMeta
*
pTableMeta
=
NULL
;
SEpSet
ep
=
getEpSet_s
(
&
info
->
taos
->
pAppInfo
->
mgmtEp
);
size_t
superTableLen
=
0
;
size_t
superTableLen
=
0
;
void
*
superTable
=
taosHashGetKey
(
tableMetaSml
,
&
superTableLen
);
void
*
superTable
=
taosHashGetKey
(
tableMetaSml
,
&
superTableLen
);
SName
pName
=
{
TSDB_TABLE_NAME_T
,
info
->
taos
->
acctId
,
{
0
},
{
0
}};
memset
(
pName
.
tname
,
0
,
TSDB_TABLE_NAME_LEN
);
strcpy
(
pName
.
dbname
,
info
->
pRequest
->
pDb
);
memcpy
(
pName
.
tname
,
superTable
,
superTableLen
);
memcpy
(
pName
.
tname
,
superTable
,
superTableLen
);
code
=
catalogGetSTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
&
pTableMeta
);
code
=
catalogGetSTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
&
pTableMeta
);
...
@@ -487,7 +487,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
...
@@ -487,7 +487,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
code
=
smlApplySchemaAction
(
info
,
&
schemaAction
);
code
=
smlApplySchemaAction
(
info
,
&
schemaAction
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:0x%"
PRIx64
" smlApplySchemaAction failed. can not create %s"
,
info
->
id
,
schemaAction
.
createSTable
.
sTableName
);
uError
(
"SML:0x%"
PRIx64
" smlApplySchemaAction failed. can not create %s"
,
info
->
id
,
schemaAction
.
createSTable
.
sTableName
);
return
code
;
goto
end
;
}
}
info
->
cost
.
numOfCreateSTables
++
;
info
->
cost
.
numOfCreateSTables
++
;
}
else
if
(
code
==
TSDB_CODE_SUCCESS
)
{
}
else
if
(
code
==
TSDB_CODE_SUCCESS
)
{
...
@@ -502,7 +502,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
...
@@ -502,7 +502,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
code
=
smlProcessSchemaAction
(
info
,
pTableMeta
->
schema
,
hashTmp
,
sTableData
->
tags
,
&
schemaAction
,
true
);
code
=
smlProcessSchemaAction
(
info
,
pTableMeta
->
schema
,
hashTmp
,
sTableData
->
tags
,
&
schemaAction
,
true
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosHashCleanup
(
hashTmp
);
taosHashCleanup
(
hashTmp
);
return
code
;
goto
end
;
}
}
taosHashClear
(
hashTmp
);
taosHashClear
(
hashTmp
);
...
@@ -512,29 +512,33 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
...
@@ -512,29 +512,33 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) {
code
=
smlProcessSchemaAction
(
info
,
pTableMeta
->
schema
,
hashTmp
,
sTableData
->
cols
,
&
schemaAction
,
false
);
code
=
smlProcessSchemaAction
(
info
,
pTableMeta
->
schema
,
hashTmp
,
sTableData
->
cols
,
&
schemaAction
,
false
);
taosHashCleanup
(
hashTmp
);
taosHashCleanup
(
hashTmp
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
end
;
}
}
code
=
catalogRefreshTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
-
1
);
code
=
catalogRefreshTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
1
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
end
;
}
}
}
else
{
}
else
{
uError
(
"SML:0x%"
PRIx64
" load table meta error: %s"
,
info
->
id
,
tstrerror
(
code
));
uError
(
"SML:0x%"
PRIx64
" load table meta error: %s"
,
info
->
id
,
tstrerror
(
code
));
return
code
;
goto
end
;
}
}
if
(
pTableMeta
)
taosMemoryFree
(
pTableMeta
);
if
(
pTableMeta
)
taosMemoryFree
(
pTableMeta
);
code
=
catalogGetSTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
&
pTableMeta
);
code
=
catalogGetSTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
&
pTableMeta
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:0x%"
PRIx64
" catalogGetSTableMeta failed. super table name %s"
,
info
->
id
,
(
char
*
)
superTable
);
uError
(
"SML:0x%"
PRIx64
" catalogGetSTableMeta failed. super table name %s"
,
info
->
id
,
(
char
*
)
superTable
);
return
code
;
goto
end
;
}
}
sTableData
->
tableMeta
=
pTableMeta
;
sTableData
->
tableMeta
=
pTableMeta
;
tableMetaSml
=
(
SSmlSTableMeta
**
)
taosHashIterate
(
info
->
superTables
,
tableMetaSml
);
tableMetaSml
=
(
SSmlSTableMeta
**
)
taosHashIterate
(
info
->
superTables
,
tableMetaSml
);
}
}
return
0
;
return
0
;
end:
catalogRefreshTableMeta
(
info
->
pCatalog
,
info
->
taos
->
pAppInfo
->
pTransporter
,
&
ep
,
&
pName
,
1
);
return
code
;
}
}
//=========================================================================
//=========================================================================
...
@@ -1544,7 +1548,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
...
@@ -1544,7 +1548,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
}
}
size_t
typeLen
=
strlen
(
type
->
valuestring
);
size_t
typeLen
=
strlen
(
type
->
valuestring
);
if
(
typeLen
==
1
&&
type
->
valuestring
[
0
]
==
's'
)
{
if
(
typeLen
==
1
&&
(
type
->
valuestring
[
0
]
==
's'
||
type
->
valuestring
[
0
]
==
'S'
)
)
{
//seconds
//seconds
timeDouble
=
timeDouble
*
1e9
;
timeDouble
=
timeDouble
*
1e9
;
if
(
smlDoubleToInt64OverFlow
(
timeDouble
)){
if
(
smlDoubleToInt64OverFlow
(
timeDouble
)){
...
@@ -1552,9 +1556,10 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
...
@@ -1552,9 +1556,10 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
return
TSDB_CODE_TSC_INVALID_TIME_STAMP
;
return
TSDB_CODE_TSC_INVALID_TIME_STAMP
;
}
}
*
tsVal
=
timeDouble
;
*
tsVal
=
timeDouble
;
}
else
if
(
typeLen
==
2
&&
type
->
valuestring
[
1
]
==
's'
)
{
}
else
if
(
typeLen
==
2
&&
(
type
->
valuestring
[
1
]
==
's'
||
type
->
valuestring
[
1
]
==
'S'
)
)
{
switch
(
type
->
valuestring
[
0
])
{
switch
(
type
->
valuestring
[
0
])
{
case
'm'
:
case
'm'
:
case
'M'
:
//milliseconds
//milliseconds
timeDouble
=
timeDouble
*
1e6
;
timeDouble
=
timeDouble
*
1e6
;
if
(
smlDoubleToInt64OverFlow
(
timeDouble
)){
if
(
smlDoubleToInt64OverFlow
(
timeDouble
)){
...
@@ -1564,6 +1569,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
...
@@ -1564,6 +1569,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
*
tsVal
=
timeDouble
;
*
tsVal
=
timeDouble
;
break
;
break
;
case
'u'
:
case
'u'
:
case
'U'
:
//microseconds
//microseconds
timeDouble
=
timeDouble
*
1e3
;
timeDouble
=
timeDouble
*
1e3
;
if
(
smlDoubleToInt64OverFlow
(
timeDouble
)){
if
(
smlDoubleToInt64OverFlow
(
timeDouble
)){
...
@@ -1573,6 +1579,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
...
@@ -1573,6 +1579,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV
*
tsVal
=
timeDouble
;
*
tsVal
=
timeDouble
;
break
;
break
;
case
'n'
:
case
'n'
:
case
'N'
:
//nanoseconds
//nanoseconds
*
tsVal
=
timeDouble
;
*
tsVal
=
timeDouble
;
break
;
break
;
...
@@ -2285,6 +2292,8 @@ static int32_t smlParseLine(SSmlHandle *info, char* lines[], int numLines){
...
@@ -2285,6 +2292,8 @@ static int32_t smlParseLine(SSmlHandle *info, char* lines[], int numLines){
static
int
smlProcess
(
SSmlHandle
*
info
,
char
*
lines
[],
int
numLines
)
{
static
int
smlProcess
(
SSmlHandle
*
info
,
char
*
lines
[],
int
numLines
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
retryNum
=
0
;
info
->
cost
.
parseTime
=
taosGetTimestampUs
();
info
->
cost
.
parseTime
=
taosGetTimestampUs
();
code
=
smlParseLine
(
info
,
lines
,
numLines
);
code
=
smlParseLine
(
info
,
lines
,
numLines
);
...
@@ -2298,7 +2307,12 @@ static int smlProcess(SSmlHandle *info, char* lines[], int numLines) {
...
@@ -2298,7 +2307,12 @@ static int smlProcess(SSmlHandle *info, char* lines[], int numLines) {
info
->
cost
.
numOfCTables
=
taosHashGetSize
(
info
->
childTables
);
info
->
cost
.
numOfCTables
=
taosHashGetSize
(
info
->
childTables
);
info
->
cost
.
schemaTime
=
taosGetTimestampUs
();
info
->
cost
.
schemaTime
=
taosGetTimestampUs
();
do
{
code
=
smlModifyDBSchemas
(
info
);
code
=
smlModifyDBSchemas
(
info
);
if
(
code
==
0
)
break
;
}
while
(
retryNum
++
<
taosHashGetSize
(
info
->
superTables
));
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
uError
(
"SML:0x%"
PRIx64
" smlModifyDBSchemas error : %s"
,
info
->
id
,
tstrerror
(
code
));
uError
(
"SML:0x%"
PRIx64
" smlModifyDBSchemas error : %s"
,
info
->
id
,
tstrerror
(
code
));
goto
cleanup
;
goto
cleanup
;
...
@@ -2409,6 +2423,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
...
@@ -2409,6 +2423,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
info
->
pRequest
->
code
=
smlProcess
(
info
,
lines
,
numLines
);
info
->
pRequest
->
code
=
smlProcess
(
info
,
lines
,
numLines
);
end:
end:
info
->
taos
->
schemalessType
=
0
;
uDebug
(
"result:%s"
,
info
->
msgBuf
.
buf
);
uDebug
(
"result:%s"
,
info
->
msgBuf
.
buf
);
smlDestroyInfo
(
info
);
smlDestroyInfo
(
info
);
return
(
TAOS_RES
*
)
request
;
return
(
TAOS_RES
*
)
request
;
...
...
source/client/test/smlTest.cpp
浏览文件 @
903ecc5a
...
@@ -1272,14 +1272,40 @@ TEST(testCase, sml_params_Test) {
...
@@ -1272,14 +1272,40 @@ TEST(testCase, sml_params_Test) {
};
};
TAOS_RES
*
res
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql
,
1
,
TSDB_SML_LINE_PROTOCOL
,
TSDB_SML_TIMESTAMP_MILLI_SECONDS
);
TAOS_RES
*
res
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql
,
1
,
TSDB_SML_LINE_PROTOCOL
,
TSDB_SML_TIMESTAMP_MILLI_SECONDS
);
ASSERT_EQ
(
taos_errno
(
res
),
TSDB_CODE_PAR_DB_NOT_SPECIFIED
);
ASSERT_EQ
(
taos_errno
(
res
),
TSDB_CODE_PAR_DB_NOT_SPECIFIED
);
taos_free_result
(
pR
es
);
taos_free_result
(
r
es
);
pRes
=
taos_query
(
taos
,
"use param"
);
pRes
=
taos_query
(
taos
,
"use param"
);
taos_free_result
(
pR
es
);
taos_free_result
(
r
es
);
res
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql
,
1
,
TSDB_SML_LINE_PROTOCOL
,
TSDB_SML_TIMESTAMP_MILLI_SECONDS
);
res
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql
,
1
,
TSDB_SML_LINE_PROTOCOL
,
TSDB_SML_TIMESTAMP_MILLI_SECONDS
);
ASSERT_EQ
(
taos_errno
(
res
),
TSDB_CODE_SML_INVALID_DB_CONF
);
ASSERT_EQ
(
taos_errno
(
res
),
TSDB_CODE_SML_INVALID_DB_CONF
);
taos_free_result
(
res
);
}
TEST
(
testCase
,
sml_16384_Test
)
{
TAOS
*
taos
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
taos
,
nullptr
);
TAOS_RES
*
pRes
=
taos_query
(
taos
,
"create database if not exists d16384 schemaless 1"
);
taos_free_result
(
pRes
);
const
char
*
sql
[]
=
{
"qelhxo,id=pnnqhsa,t0=t,t1=127i8 c0=t,c1=127i8 1626006833639000000"
,
};
pRes
=
taos_query
(
taos
,
"use d16384"
);
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
TAOS_RES
*
res
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql
,
1
,
TSDB_SML_LINE_PROTOCOL
,
0
);
ASSERT_EQ
(
taos_errno
(
res
),
0
);
taos_free_result
(
res
);
const
char
*
sql1
[]
=
{
"qelhxo,id=pnnqhsa,t0=t,t1=127i8 c0=f,c1=127i8,c11=L
\"
ncharColValue
\"
,c10=t 1626006833639000000"
,
};
TAOS_RES
*
res1
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql1
,
1
,
TSDB_SML_LINE_PROTOCOL
,
0
);
ASSERT_EQ
(
taos_errno
(
res1
),
0
);
taos_free_result
(
res1
);
}
}
TEST
(
testCase
,
sml_oom_Test
)
{
TEST
(
testCase
,
sml_oom_Test
)
{
...
@@ -1303,3 +1329,29 @@ TEST(testCase, sml_oom_Test) {
...
@@ -1303,3 +1329,29 @@ TEST(testCase, sml_oom_Test) {
ASSERT_EQ
(
taos_errno
(
res
),
0
);
ASSERT_EQ
(
taos_errno
(
res
),
0
);
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
}
}
TEST
(
testCase
,
sml_16368_Test
)
{
TAOS
*
taos
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
taos
,
nullptr
);
TAOS_RES
*
pRes
=
taos_query
(
taos
,
"create database if not exists d16368 schemaless 1"
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
taos
,
"use d16368"
);
taos_free_result
(
pRes
);
const
char
*
sql
[]
=
{
"[{
\"
metric
\"
:
\"
st123456
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833639000,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: 1,
\"
tags
\"
: {
\"
t1
\"
: 3,
\"
t2
\"
: {
\"
value
\"
: 4,
\"
type
\"
:
\"
double
\"
},
\"
t3
\"
: {
\"
value
\"
:
\"
t3
\"
,
\"
type
\"
:
\"
binary
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
st123456
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833739000,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: 2,
\"
tags
\"
: {
\"
t1
\"
: {
\"
value
\"
: 4,
\"
type
\"
:
\"
double
\"
},
\"
t3
\"
: {
\"
value
\"
:
\"
t4
\"
,
\"
type
\"
:
\"
binary
\"
},
\"
t2
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
},
\"
t4
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
stb_name
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833639100,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: 3,
\"
tags
\"
: {
\"
t2
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
},
\"
t3
\"
: {
\"
value
\"
:
\"
ste
\"
,
\"
type
\"
:
\"
nchar
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
stf567890
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833639200,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: 4,
\"
tags
\"
: {
\"
t1
\"
: {
\"
value
\"
: 4,
\"
type
\"
:
\"
bigint
\"
},
\"
t3
\"
: {
\"
value
\"
:
\"
t4
\"
,
\"
type
\"
:
\"
binary
\"
},
\"
t2
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
},
\"
t4
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
st123456
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833639300,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
},
\"
tags
\"
: {
\"
t1
\"
: {
\"
value
\"
: 4,
\"
type
\"
:
\"
double
\"
},
\"
t2
\"
: 5.0,
\"
t3
\"
: {
\"
value
\"
:
\"
t4
\"
,
\"
type
\"
:
\"
binary
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
stb_name
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833639400,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: {
\"
value
\"
: 6,
\"
type
\"
:
\"
double
\"
},
\"
tags
\"
: {
\"
t2
\"
: 5.0,
\"
t3
\"
: {
\"
value
\"
:
\"
ste2
\"
,
\"
type
\"
:
\"
nchar
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
stb_name
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006834639400,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: {
\"
value
\"
: 7,
\"
type
\"
:
\"
double
\"
},
\"
tags
\"
: {
\"
t2
\"
: {
\"
value
\"
: 5.0,
\"
type
\"
:
\"
double
\"
},
\"
t3
\"
: {
\"
value
\"
:
\"
ste2
\"
,
\"
type
\"
:
\"
nchar
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
st123456
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833839006,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: {
\"
value
\"
: 8,
\"
type
\"
:
\"
double
\"
},
\"
tags
\"
: {
\"
t1
\"
: {
\"
value
\"
: 4,
\"
type
\"
:
\"
double
\"
},
\"
t3
\"
: {
\"
value
\"
:
\"
t4
\"
,
\"
type
\"
:
\"
binary
\"
},
\"
t2
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
},
\"
t4
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
}}},
\n
"
"{
\"
metric
\"
:
\"
st123456
\"
,
\"
timestamp
\"
: {
\"
value
\"
: 1626006833939007,
\"
type
\"
:
\"
us
\"
},
\"
value
\"
: {
\"
value
\"
: 9,
\"
type
\"
:
\"
double
\"
},
\"
tags
\"
: {
\"
t1
\"
: 4,
\"
t3
\"
: {
\"
value
\"
:
\"
t4
\"
,
\"
type
\"
:
\"
binary
\"
},
\"
t2
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
},
\"
t4
\"
: {
\"
value
\"
: 5,
\"
type
\"
:
\"
double
\"
}}}]"
};
pRes
=
taos_schemaless_insert
(
taos
,
(
char
**
)
sql
,
sizeof
(
sql
)
/
sizeof
(
sql
[
0
]),
TSDB_SML_JSON_PROTOCOL
,
TSDB_SML_TIMESTAMP_MICRO_SECONDS
);
ASSERT_EQ
(
taos_errno
(
pRes
),
0
);
taos_free_result
(
pRes
);
}
source/common/src/tdataformat.c
浏览文件 @
903ecc5a
...
@@ -244,7 +244,7 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
...
@@ -244,7 +244,7 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
}
}
}
}
// ASSERT(flags); // only 1 column(ts)
ASSERT
(
flags
);
// decide
// decide
uint32_t
nData
=
0
;
uint32_t
nData
=
0
;
...
@@ -268,8 +268,8 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
...
@@ -268,8 +268,8 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
nDataT
=
BIT2_SIZE
(
pTSchema
->
numOfCols
-
1
)
+
pTSchema
->
flen
+
ntv
;
nDataT
=
BIT2_SIZE
(
pTSchema
->
numOfCols
-
1
)
+
pTSchema
->
flen
+
ntv
;
break
;
break
;
default:
default:
break
;
// only ts column
break
;
//
ASSERT(0);
ASSERT
(
0
);
}
}
uint8_t
tflags
=
0
;
uint8_t
tflags
=
0
;
...
@@ -374,7 +374,7 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
...
@@ -374,7 +374,7 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
ptv
=
pf
+
pTSchema
->
flen
;
ptv
=
pf
+
pTSchema
->
flen
;
break
;
break
;
default:
default:
//
ASSERT(0);
ASSERT
(
0
);
break
;
break
;
}
}
}
else
{
}
else
{
...
@@ -421,12 +421,26 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
...
@@ -421,12 +421,26 @@ int32_t tTSRowNew(STSRowBuilder *pBuilder, SArray *pArray, STSchema *pTSchema, S
_set_none:
_set_none:
if
((
flags
&
0xf0
)
==
0
)
{
if
((
flags
&
0xf0
)
==
0
)
{
setBitMap
(
pb
,
0
,
iColumn
-
1
,
flags
);
setBitMap
(
pb
,
0
,
iColumn
-
1
,
flags
);
if
(
flags
&
TSROW_HAS_VAL
)
{
// set 0
if
(
IS_VAR_DATA_TYPE
(
pTColumn
->
type
))
{
*
(
VarDataOffsetT
*
)(
pf
+
pTColumn
->
offset
)
=
0
;
}
else
{
tPutValue
(
pf
+
pTColumn
->
offset
,
&
((
SValue
){
0
}),
pTColumn
->
type
);
}
}
}
}
continue
;
continue
;
_set_null:
_set_null:
if
((
flags
&
0xf0
)
==
0
)
{
if
((
flags
&
0xf0
)
==
0
)
{
setBitMap
(
pb
,
1
,
iColumn
-
1
,
flags
);
setBitMap
(
pb
,
1
,
iColumn
-
1
,
flags
);
if
(
flags
&
TSROW_HAS_VAL
)
{
// set 0
if
(
IS_VAR_DATA_TYPE
(
pTColumn
->
type
))
{
*
(
VarDataOffsetT
*
)(
pf
+
pTColumn
->
offset
)
=
0
;
}
else
{
tPutValue
(
pf
+
pTColumn
->
offset
,
&
((
SValue
){
0
}),
pTColumn
->
type
);
}
}
}
else
{
}
else
{
SET_IDX
(
pidx
,
pTSKVRow
->
nCols
,
nkv
,
flags
);
SET_IDX
(
pidx
,
pTSKVRow
->
nCols
,
nkv
,
flags
);
pTSKVRow
->
nCols
++
;
pTSKVRow
->
nCols
++
;
...
@@ -497,7 +511,7 @@ void tTSRowGet(STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal
...
@@ -497,7 +511,7 @@ void tTSRowGet(STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal
SValue
value
;
SValue
value
;
ASSERT
(
iCol
<
pTSchema
->
numOfCols
);
ASSERT
(
iCol
<
pTSchema
->
numOfCols
);
// ASSERT(flags); // only 1 ts column
ASSERT
(
flags
);
ASSERT
(
pRow
->
sver
==
pTSchema
->
version
);
ASSERT
(
pRow
->
sver
==
pTSchema
->
version
);
if
(
iCol
==
0
)
{
if
(
iCol
==
0
)
{
...
...
source/common/test/dataformatTest.cpp
浏览文件 @
903ecc5a
...
@@ -52,61 +52,61 @@ STSchema *genSTSchema(int16_t nCols) {
...
@@ -52,61 +52,61 @@ STSchema *genSTSchema(int16_t nCols) {
switch
(
i
)
{
switch
(
i
)
{
case
0
:
{
case
0
:
{
pSchema
[
0
].
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
pSchema
[
0
].
bytes
=
TYPE_BYTES
[
pSchema
[
0
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
1
:
{
case
1
:
{
pSchema
[
1
].
type
=
TSDB_DATA_TYPE_INT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_INT
;
pSchema
[
1
].
bytes
=
TYPE_BYTES
[
pSchema
[
1
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
;
;
}
break
;
}
break
;
case
2
:
{
case
2
:
{
pSchema
[
2
].
type
=
TSDB_DATA_TYPE_BIGINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_BIGINT
;
pSchema
[
2
].
bytes
=
TYPE_BYTES
[
pSchema
[
2
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
3
:
{
case
3
:
{
pSchema
[
3
].
type
=
TSDB_DATA_TYPE_FLOAT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_FLOAT
;
pSchema
[
3
].
bytes
=
TYPE_BYTES
[
pSchema
[
3
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
4
:
{
case
4
:
{
pSchema
[
4
].
type
=
TSDB_DATA_TYPE_DOUBLE
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_DOUBLE
;
pSchema
[
4
].
bytes
=
TYPE_BYTES
[
pSchema
[
4
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
5
:
{
case
5
:
{
pSchema
[
5
].
type
=
TSDB_DATA_TYPE_BINARY
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_BINARY
;
pSchema
[
5
].
bytes
=
12
;
pSchema
[
i
].
bytes
=
12
;
}
break
;
}
break
;
case
6
:
{
case
6
:
{
pSchema
[
6
].
type
=
TSDB_DATA_TYPE_NCHAR
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_NCHAR
;
pSchema
[
6
].
bytes
=
42
;
pSchema
[
i
].
bytes
=
42
;
}
break
;
}
break
;
case
7
:
{
case
7
:
{
pSchema
[
7
].
type
=
TSDB_DATA_TYPE_TINYINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_TINYINT
;
pSchema
[
7
].
bytes
=
TYPE_BYTES
[
pSchema
[
7
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
8
:
{
case
8
:
{
pSchema
[
8
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
pSchema
[
8
].
bytes
=
TYPE_BYTES
[
pSchema
[
8
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
9
:
{
case
9
:
{
pSchema
[
9
].
type
=
TSDB_DATA_TYPE_BOOL
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_BOOL
;
pSchema
[
9
].
bytes
=
TYPE_BYTES
[
pSchema
[
9
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
10
:
{
case
10
:
{
pSchema
[
10
].
type
=
TSDB_DATA_TYPE_UTINYINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_UTINYINT
;
pSchema
[
10
].
bytes
=
TYPE_BYTES
[
pSchema
[
10
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
11
:
{
case
11
:
{
pSchema
[
11
].
type
=
TSDB_DATA_TYPE_USMALLINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_USMALLINT
;
pSchema
[
11
].
bytes
=
TYPE_BYTES
[
pSchema
[
11
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
12
:
{
case
12
:
{
pSchema
[
12
].
type
=
TSDB_DATA_TYPE_UINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_UINT
;
pSchema
[
12
].
bytes
=
TYPE_BYTES
[
pSchema
[
12
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
case
13
:
{
case
13
:
{
pSchema
[
13
].
type
=
TSDB_DATA_TYPE_UBIGINT
;
pSchema
[
i
].
type
=
TSDB_DATA_TYPE_UBIGINT
;
pSchema
[
13
].
bytes
=
TYPE_BYTES
[
pSchema
[
13
].
type
];
pSchema
[
i
].
bytes
=
TYPE_BYTES
[
pSchema
[
i
].
type
];
}
break
;
}
break
;
default:
default:
...
@@ -146,9 +146,9 @@ static int32_t genTestData(const char **data, int16_t nCols, SArray **pArray) {
...
@@ -146,9 +146,9 @@ static int32_t genTestData(const char **data, int16_t nCols, SArray **pArray) {
case
0
:
case
0
:
sscanf
(
data
[
i
],
"%"
PRIi64
,
&
colVal
.
value
.
ts
);
sscanf
(
data
[
i
],
"%"
PRIi64
,
&
colVal
.
value
.
ts
);
break
;
break
;
case
1
:
{
case
1
:
sscanf
(
data
[
i
],
"%"
PRIi32
,
&
colVal
.
value
.
i32
);
sscanf
(
data
[
i
],
"%"
PRIi32
,
&
colVal
.
value
.
i32
);
}
break
;
break
;
case
2
:
case
2
:
sscanf
(
data
[
i
],
"%"
PRIi64
,
&
colVal
.
value
.
i64
);
sscanf
(
data
[
i
],
"%"
PRIi64
,
&
colVal
.
value
.
i64
);
break
;
break
;
...
@@ -274,9 +274,6 @@ int32_t debugPrintSColVal(SColVal *cv, int8_t type) {
...
@@ -274,9 +274,6 @@ int32_t debugPrintSColVal(SColVal *cv, int8_t type) {
case
TSDB_DATA_TYPE_MEDIUMBLOB
:
case
TSDB_DATA_TYPE_MEDIUMBLOB
:
printf
(
"MedBLOB "
);
printf
(
"MedBLOB "
);
break
;
break
;
// case TSDB_DATA_TYPE_BINARY:
// printf("BINARY ");
// break;
case
TSDB_DATA_TYPE_MAX
:
case
TSDB_DATA_TYPE_MAX
:
printf
(
"UNDEF "
);
printf
(
"UNDEF "
);
break
;
break
;
...
@@ -404,7 +401,8 @@ static void checkTSRow(const char **data, STSRow2 *row, STSchema *pTSchema) {
...
@@ -404,7 +401,8 @@ static void checkTSRow(const char **data, STSRow2 *row, STSchema *pTSchema) {
}
}
TEST
(
testCase
,
AllNormTest
)
{
TEST
(
testCase
,
AllNormTest
)
{
int16_t
nCols
=
1
;
int16_t
nCols
=
14
;
STSRowBuilder
rb
=
{
0
};
STSRow2
*
row
=
nullptr
;
STSRow2
*
row
=
nullptr
;
SArray
*
pArray
=
taosArrayInit
(
nCols
,
sizeof
(
SColVal
));
SArray
*
pArray
=
taosArrayInit
(
nCols
,
sizeof
(
SColVal
));
EXPECT_NE
(
pArray
,
nullptr
);
EXPECT_NE
(
pArray
,
nullptr
);
...
@@ -414,15 +412,16 @@ TEST(testCase, AllNormTest) {
...
@@ -414,15 +412,16 @@ TEST(testCase, AllNormTest) {
// ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 binary(10), c6 nchar(10), c7 tinyint, c8 smallint,
// ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 binary(10), c6 nchar(10), c7 tinyint, c8 smallint,
// c9 bool
// c9 bool
char
*
data
[
1
0
]
=
{
"1653694220000"
,
"10"
,
"20"
,
"10.1"
,
"10.1"
,
"binary10"
,
"nchar10"
,
"10"
,
"10"
,
"1
"
};
char
*
data
[
1
4
]
=
{
"1653694220000"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no
"
};
genTestData
((
const
char
**
)
&
data
,
nCols
,
&
pArray
);
genTestData
((
const
char
**
)
&
data
,
nCols
,
&
pArray
);
tTSRowNew
(
NULL
,
pArray
,
pTSchema
,
&
row
);
tTSRowNew
(
&
rb
,
pArray
,
pTSchema
,
&
row
);
debugPrintTSRow
(
row
,
pTSchema
,
__func__
,
__LINE__
);
debugPrintTSRow
(
row
,
pTSchema
,
__func__
,
__LINE__
);
checkTSRow
((
const
char
**
)
&
data
,
row
,
pTSchema
);
checkTSRow
((
const
char
**
)
&
data
,
row
,
pTSchema
);
tsRowBuilderClear
(
&
rb
);
taosArrayDestroy
(
pArray
);
taosArrayDestroy
(
pArray
);
taosMemoryFree
(
pTSchema
);
taosMemoryFree
(
pTSchema
);
}
}
...
@@ -443,12 +442,12 @@ TEST(testCase, NoneTest) {
...
@@ -443,12 +442,12 @@ TEST(testCase, NoneTest) {
const
char
*
data
[
nRows
][
nCols
]
=
{
const
char
*
data
[
nRows
][
nCols
]
=
{
{
"1653694220000"
,
"no"
,
"20"
,
"10.1"
,
"10.1"
,
"binary10"
,
"no"
,
"10"
,
"10"
,
"nu"
,
"10"
,
"20"
,
"30"
,
"40"
},
{
"1653694220000"
,
"no"
,
"20"
,
"10.1"
,
"10.1"
,
"binary10"
,
"no"
,
"10"
,
"10"
,
"nu"
,
"10"
,
"20"
,
"30"
,
"40"
},
{
"1653694220001"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
},
{
"1653694220001"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
},
{
"1653694220002"
,
"
no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"nu"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"nu
"
},
{
"1653694220002"
,
"
10"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no
"
},
{
"1653694220003"
,
"
nu"
,
"no"
,
"no"
,
"no"
,
"no"
,
"nu
"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
},
{
"1653694220003"
,
"
10"
,
"10"
,
"no"
,
"no"
,
"no"
,
"no
"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
},
{
"1653694220004"
,
"no"
,
"20"
,
"no"
,
"no"
,
"no"
,
"nchar10"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
},
{
"1653694220004"
,
"no"
,
"20"
,
"no"
,
"no"
,
"no"
,
"nchar10"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
,
"no"
},
{
"1653694220005"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
},
{
"1653694220005"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
},
{
"1653694220006"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
},
{
"1653694220006"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
},
{
"1653694220007"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"n
u"
,
"nu"
,
"nu"
,
"nu
"
,
"no"
},
{
"1653694220007"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"n
o"
,
"no"
,
"no"
,
"no
"
,
"no"
},
{
"1653694220008"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"binary10"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"no"
},
{
"1653694220008"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"binary10"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"nu"
,
"no"
},
{
"1653694220009"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"binary10"
,
"nu"
,
"nu"
,
"10"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"100"
},
{
"1653694220009"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"binary10"
,
"nu"
,
"nu"
,
"10"
,
"no"
,
"nu"
,
"nu"
,
"nu"
,
"100"
},
{
"1653694220010"
,
"-1"
,
"-1"
,
"-1"
,
"-1"
,
"binary10"
,
"nu"
,
"-1"
,
"0"
,
"0"
,
"0"
,
"0"
,
"0"
,
"0"
},
{
"1653694220010"
,
"-1"
,
"-1"
,
"-1"
,
"-1"
,
"binary10"
,
"nu"
,
"-1"
,
"0"
,
"0"
,
"0"
,
"0"
,
"0"
,
"0"
},
...
@@ -465,13 +464,12 @@ TEST(testCase, NoneTest) {
...
@@ -465,13 +464,12 @@ TEST(testCase, NoneTest) {
{
"1653694220019"
,
"no"
,
"9223372036854775807"
,
"nu"
,
"nu"
,
"bin10"
,
"nu"
,
"nu"
,
"10"
,
"no"
,
"254"
,
"nu"
,
"nu"
,
{
"1653694220019"
,
"no"
,
"9223372036854775807"
,
"nu"
,
"nu"
,
"bin10"
,
"nu"
,
"nu"
,
"10"
,
"no"
,
"254"
,
"nu"
,
"nu"
,
"no"
}};
"no"
}};
for
(
int
r
=
0
;
r
<
nRows
;
++
r
)
{
for
(
int
r
=
0
;
r
<
nRows
;
++
r
)
{
genTestData
((
const
char
**
)
&
data
[
r
],
nCols
,
&
pArray
);
genTestData
((
const
char
**
)
&
data
[
r
],
nCols
,
&
pArray
);
tTSRowNew
(
NULL
,
pArray
,
pTSchema
,
&
row
);
tTSRowNew
(
NULL
,
pArray
,
pTSchema
,
&
row
);
debugPrintTSRow
(
row
,
pTSchema
,
__func__
,
__LINE__
);
// debug print
debugPrintTSRow
(
row
,
pTSchema
,
__func__
,
__LINE__
);
// debug print
checkTSRow
((
const
char
**
)
&
data
[
r
],
row
,
pTSchema
);
// check
checkTSRow
((
const
char
**
)
&
data
[
r
],
row
,
pTSchema
);
// check
t
aosMemoryFreeClear
(
row
);
t
TSRowFree
(
row
);
taosArrayClear
(
pArray
);
taosArrayClear
(
pArray
);
}
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
903ecc5a
...
@@ -1756,6 +1756,7 @@ SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysi
...
@@ -1756,6 +1756,7 @@ SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysi
;
;
pInfo
->
readHandle
=
*
pReadHandle
;
pInfo
->
readHandle
=
*
pReadHandle
;
pInfo
->
curPos
=
0
;
pInfo
->
curPos
=
0
;
pInfo
->
pFilterNode
=
pPhyNode
->
node
.
pConditions
;
pOperator
->
name
=
"TagScanOperator"
;
pOperator
->
name
=
"TagScanOperator"
;
pOperator
->
operatorType
=
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
;
pOperator
->
operatorType
=
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
;
pOperator
->
blocking
=
false
;
pOperator
->
blocking
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录