Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4ebdb936
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看板
未验证
提交
4ebdb936
编写于
5月 13, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
5月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12448 from taosdata/feature/TD-14761
fea: add test case for schemaless
上级
8e5b263d
f284226f
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
755 addition
and
418 deletion
+755
-418
include/common/tcommon.h
include/common/tcommon.h
+8
-9
source/client/src/clientSml.c
source/client/src/clientSml.c
+186
-157
source/client/test/smlTest.cpp
source/client/test/smlTest.cpp
+543
-244
source/common/src/tname.c
source/common/src/tname.c
+5
-1
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+13
-7
未找到文件。
include/common/tcommon.h
浏览文件 @
4ebdb936
...
@@ -201,18 +201,17 @@ typedef struct SExprInfo {
...
@@ -201,18 +201,17 @@ typedef struct SExprInfo {
}
SExprInfo
;
}
SExprInfo
;
typedef
struct
{
typedef
struct
{
const
char
*
key
;
const
char
*
key
;
int32_t
keyLen
;
int32_t
keyLen
;
uint8_t
type
;
uint8_t
type
;
int16_t
length
;
union
{
union
{
const
char
*
value
;
const
char
*
value
;
int64_t
i
;
int64_t
i
;
uint64_t
u
;
uint64_t
u
;
double
d
;
double
d
;
float
f
;
float
f
;
};
};
int32_t
valueLen
;
int32_t
length
;
}
SSmlKv
;
}
SSmlKv
;
#define QUERY_ASC_FORWARD_STEP 1
#define QUERY_ASC_FORWARD_STEP 1
...
...
source/client/src/clientSml.c
浏览文件 @
4ebdb936
此差异已折叠。
点击以展开。
source/client/test/smlTest.cpp
浏览文件 @
4ebdb936
此差异已折叠。
点击以展开。
source/common/src/tname.c
浏览文件 @
4ebdb936
...
@@ -317,7 +317,11 @@ void buildChildTableName(RandTableName* rName) {
...
@@ -317,7 +317,11 @@ void buildChildTableName(RandTableName* rName) {
for
(
int
j
=
0
;
j
<
size
;
++
j
)
{
for
(
int
j
=
0
;
j
<
size
;
++
j
)
{
SSmlKv
*
tagKv
=
taosArrayGetP
(
rName
->
tags
,
j
);
SSmlKv
*
tagKv
=
taosArrayGetP
(
rName
->
tags
,
j
);
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
key
,
tagKv
->
keyLen
);
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
key
,
tagKv
->
keyLen
);
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
value
,
tagKv
->
valueLen
);
if
(
IS_VAR_DATA_TYPE
(
tagKv
->
type
)){
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
value
,
tagKv
->
length
);
}
else
{
taosStringBuilderAppendStringLen
(
&
sb
,
(
char
*
)(
&
(
tagKv
->
value
)),
tagKv
->
length
);
}
}
}
size_t
len
=
0
;
size_t
len
=
0
;
char
*
keyJoined
=
taosStringBuilderGetResult
(
&
sb
,
&
len
);
char
*
keyJoined
=
taosStringBuilderGetResult
(
&
sb
,
&
len
);
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
4ebdb936
...
@@ -758,7 +758,7 @@ static int32_t KvRowAppend(SMsgBuf* pMsgBuf, const void* value, int32_t len, voi
...
@@ -758,7 +758,7 @@ static int32_t KvRowAppend(SMsgBuf* pMsgBuf, const void* value, int32_t len, voi
int32_t
output
=
0
;
int32_t
output
=
0
;
if
(
!
taosMbsToUcs4
(
value
,
len
,
(
TdUcs4
*
)
varDataVal
(
pa
->
buf
),
pa
->
schema
->
bytes
-
VARSTR_HEADER_SIZE
,
&
output
))
{
if
(
!
taosMbsToUcs4
(
value
,
len
,
(
TdUcs4
*
)
varDataVal
(
pa
->
buf
),
pa
->
schema
->
bytes
-
VARSTR_HEADER_SIZE
,
&
output
))
{
char
buf
[
512
]
=
{
0
};
char
buf
[
512
]
=
{
0
};
snprintf
(
buf
,
tListLen
(
buf
),
"%s"
,
strerror
(
errno
));
snprintf
(
buf
,
tListLen
(
buf
),
"
taosMbsToUcs4 error:
%s"
,
strerror
(
errno
));
return
buildSyntaxErrMsg
(
pMsgBuf
,
buf
,
value
);
return
buildSyntaxErrMsg
(
pMsgBuf
,
buf
,
value
);
}
}
...
@@ -1668,7 +1668,11 @@ static int32_t smlBuildTagRow(SArray* cols, SKVRowBuilder* tagsBuilder, SParsedD
...
@@ -1668,7 +1668,11 @@ static int32_t smlBuildTagRow(SArray* cols, SKVRowBuilder* tagsBuilder, SParsedD
SSchema
*
pTagSchema
=
&
pSchema
[
tags
->
boundColumns
[
i
]
-
1
];
// colId starts with 1
SSchema
*
pTagSchema
=
&
pSchema
[
tags
->
boundColumns
[
i
]
-
1
];
// colId starts with 1
param
.
schema
=
pTagSchema
;
param
.
schema
=
pTagSchema
;
SSmlKv
*
kv
=
taosArrayGetP
(
cols
,
i
);
SSmlKv
*
kv
=
taosArrayGetP
(
cols
,
i
);
KvRowAppend
(
msg
,
kv
->
value
,
kv
->
valueLen
,
&
param
);
if
(
IS_VAR_DATA_TYPE
(
kv
->
type
)){
KvRowAppend
(
msg
,
kv
->
value
,
kv
->
length
,
&
param
);
}
else
{
KvRowAppend
(
msg
,
&
(
kv
->
value
),
kv
->
length
,
&
param
);
}
}
}
*
row
=
tdGetKVRowFromBuilder
(
tagsBuilder
);
*
row
=
tdGetKVRowFromBuilder
(
tagsBuilder
);
...
@@ -1766,14 +1770,16 @@ int32_t smlBindData(void *handle, SArray *tags, SArray *colsSchema, SArray *cols
...
@@ -1766,14 +1770,16 @@ int32_t smlBindData(void *handle, SArray *tags, SArray *colsSchema, SArray *cols
if
(
!
kv
||
kv
->
length
==
0
)
{
if
(
!
kv
||
kv
->
length
==
0
)
{
MemRowAppend
(
&
pBuf
,
NULL
,
0
,
&
param
);
MemRowAppend
(
&
pBuf
,
NULL
,
0
,
&
param
);
}
else
{
}
else
{
int32_t
colLen
=
pColSchema
->
bytes
;
int32_t
colLen
=
kv
->
length
;
if
(
IS_VAR_DATA_TYPE
(
pColSchema
->
type
))
{
if
(
pColSchema
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
colLen
=
kv
->
length
;
}
else
if
(
pColSchema
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
kv
->
i
=
convertTimePrecision
(
kv
->
i
,
TSDB_TIME_PRECISION_NANO
,
pTableMeta
->
tableInfo
.
precision
);
kv
->
i
=
convertTimePrecision
(
kv
->
i
,
TSDB_TIME_PRECISION_NANO
,
pTableMeta
->
tableInfo
.
precision
);
}
}
MemRowAppend
(
&
pBuf
,
&
(
kv
->
value
),
colLen
,
&
param
);
if
(
IS_VAR_DATA_TYPE
(
kv
->
type
)){
MemRowAppend
(
&
pBuf
,
kv
->
value
,
colLen
,
&
param
);
}
else
{
MemRowAppend
(
&
pBuf
,
&
(
kv
->
value
),
colLen
,
&
param
);
}
}
}
if
(
PRIMARYKEY_TIMESTAMP_COL_ID
==
pColSchema
->
colId
)
{
if
(
PRIMARYKEY_TIMESTAMP_COL_ID
==
pColSchema
->
colId
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录