Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
df32470f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
df32470f
编写于
12月 14, 2021
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6677]<test>: modify testcase about chaning json(100) to json
上级
567335bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
6 deletion
+7
-6
tests/pytest/tag_lite/json_tag_extra.py
tests/pytest/tag_lite/json_tag_extra.py
+7
-6
未找到文件。
tests/pytest/tag_lite/json_tag_extra.py
浏览文件 @
df32470f
...
@@ -33,9 +33,10 @@ class TDTestCase:
...
@@ -33,9 +33,10 @@ class TDTestCase:
tdSql
.
execute
(
"create database db_json"
)
tdSql
.
execute
(
"create database db_json"
)
tdSql
.
execute
(
"use db_json"
)
tdSql
.
execute
(
"use db_json"
)
# test tag format
# test tag format
tdSql
.
execute
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json(128))"
)
tdSql
.
execute
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json)"
)
tdSql
.
error
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json(64),jtag1 json(100))"
)
tdSql
.
error
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json(10000000))"
)
tdSql
.
error
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json(64),dataBool bool)"
)
tdSql
.
error
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json,jtag1 json)"
)
tdSql
.
error
(
"create table if not exists jsons1(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json,dataBool bool)"
)
tdSql
.
execute
(
"CREATE TABLE if not exists jsons1_1 using jsons1 tags('{
\"
loc
\"
:
\"
fff
\"
,
\"
id
\"
:5}')"
)
tdSql
.
execute
(
"CREATE TABLE if not exists jsons1_1 using jsons1 tags('{
\"
loc
\"
:
\"
fff
\"
,
\"
id
\"
:5}')"
)
...
@@ -51,7 +52,7 @@ class TDTestCase:
...
@@ -51,7 +52,7 @@ class TDTestCase:
tdSql
.
error
(
"CREATE TABLE if not exists jsons1_1 using jsons1 tags('[{
\"
num
\"
:5}]')"
)
tdSql
.
error
(
"CREATE TABLE if not exists jsons1_1 using jsons1 tags('[{
\"
num
\"
:5}]')"
)
# test object and key max length. max key length is 256, max object length is 4096 include abcd.
# test object and key max length. max key length is 256, max object length is 4096 include abcd.
tdSql
.
execute
(
"create table if not exists jsons4(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json
(128)
)"
)
tdSql
.
execute
(
"create table if not exists jsons4(ts timestamp, dataInt int, dataStr nchar(50)) tags(jtag json)"
)
char1
=
''
.
join
([
'abcd'
]
*
64
)
char1
=
''
.
join
([
'abcd'
]
*
64
)
char2
=
''
.
join
(
char1
)
char2
=
''
.
join
(
char1
)
...
@@ -69,7 +70,7 @@ class TDTestCase:
...
@@ -69,7 +70,7 @@ class TDTestCase:
tdSql
.
execute
(
"insert into jsons1_4 using jsons1 tags('{
\"
class
\"
:55,
\"
location
\"
:
\"
beijing
\"
,
\"
name
\"
:
\"
name4
\"
}') values (now, 1, 'json4')"
)
tdSql
.
execute
(
"insert into jsons1_4 using jsons1 tags('{
\"
class
\"
:55,
\"
location
\"
:
\"
beijing
\"
,
\"
name
\"
:
\"
name4
\"
}') values (now, 1, 'json4')"
)
# test : json'vaule is null and
# test : json'vaule is null and
tdSql
.
execute
(
"create table if not exists jsons2(ts timestamp, dataInt2 int, dataStr2 nchar(50)) tags(jtag2 json
(300)
)"
)
tdSql
.
execute
(
"create table if not exists jsons2(ts timestamp, dataInt2 int, dataStr2 nchar(50)) tags(jtag2 json)"
)
tdSql
.
execute
(
"CREATE TABLE if not exists jsons2_1 using jsons2 tags('{}')"
)
tdSql
.
execute
(
"CREATE TABLE if not exists jsons2_1 using jsons2 tags('{}')"
)
tdSql
.
query
(
"select jtag2 from jsons2_1"
)
tdSql
.
query
(
"select jtag2 from jsons2_1"
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
@@ -329,7 +330,7 @@ class TDTestCase:
...
@@ -329,7 +330,7 @@ class TDTestCase:
tdSql
.
error
(
"insert into jsons1_13 using jsons1 tags(3)"
)
tdSql
.
error
(
"insert into jsons1_13 using jsons1 tags(3)"
)
# test query normal column,tag and tbname
# test query normal column,tag and tbname
tdSql
.
execute
(
"create stable if not exists jsons3(ts timestamp, dataInt3 int
(100)
, dataBool3 bool, dataStr3 nchar(50)) tags(jtag3 json)"
)
tdSql
.
execute
(
"create stable if not exists jsons3(ts timestamp, dataInt3 int, dataBool3 bool, dataStr3 nchar(50)) tags(jtag3 json)"
)
tdSql
.
execute
(
"create table jsons3_2 using jsons3 tags('{
\"
t
\"
:true,
\"
t123
\"
:123,
\"\"
:
\"
true
\"
}')"
)
tdSql
.
execute
(
"create table jsons3_2 using jsons3 tags('{
\"
t
\"
:true,
\"
t123
\"
:123,
\"\"
:
\"
true
\"
}')"
)
tdSql
.
execute
(
"create table jsons3_3 using jsons3 tags('{
\"
t
\"
:true,
\"
t123
\"
:456,
\"
k1
\"
:true,
\"
str1
\"
:
\"
111
\"
}')"
)
tdSql
.
execute
(
"create table jsons3_3 using jsons3 tags('{
\"
t
\"
:true,
\"
t123
\"
:456,
\"
k1
\"
:true,
\"
str1
\"
:
\"
111
\"
}')"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录