Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
97822ce5
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看板
未验证
提交
97822ce5
编写于
12月 08, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18825 from taosdata/test/TS-2186
test: add test case for long column
上级
f6e432b4
2f774144
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
77 addition
and
0 deletion
+77
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/pytest/insert/long_string.py
tests/pytest/insert/long_string.py
+76
-0
未找到文件。
tests/parallel_test/cases.task
浏览文件 @
97822ce5
...
@@ -816,6 +816,7 @@
...
@@ -816,6 +816,7 @@
3,,pytest,python3 test.py -f table/tbNameCaseSensitive.py
3,,pytest,python3 test.py -f table/tbNameCaseSensitive.py
3,,pytest,python3 test.py -f functions/function_max_row.py
3,,pytest,python3 test.py -f functions/function_max_row.py
3,,pytest,python3 test.py -f functions/function_min_row.py
3,,pytest,python3 test.py -f functions/function_min_row.py
3,,pytest,python3 test.py -f insert/long_string.py
3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py
3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py
3,,develop-test,python3 ./test.py -f 2-query/ts_shortcut.py
3,,develop-test,python3 ./test.py -f 2-query/ts_shortcut.py
3,,develop-test,python3 ./test.py -f 2-query/nchar_funcs.py
3,,develop-test,python3 ./test.py -f 2-query/nchar_funcs.py
...
...
tests/pytest/insert/long_string.py
0 → 100644
浏览文件 @
97822ce5
###################################################################
# Copyright (c) 2021 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.types
import
TDSmlProtocolType
,
TDSmlTimestampType
import
random
import
string
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
}
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
self
.
tables
=
10
self
.
rows
=
10
self
.
ts
=
1667235600000
self
.
str_prefix
=
"test"
def
generate_string
(
self
,
length
):
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
v
=
""
for
i
in
range
(
length
):
v
+=
random
.
choice
(
chars
)
return
v
def
prepare_data
(
self
):
tdSql
.
prepare
()
str
=
self
.
str_prefix
+
self
.
generate_string
(
65505
)
tdSql
.
execute
(
"create table stb1(ts timestamp, c1 int, c2 float, c3 binary(%d)) tags(t1 int)"
%
len
(
str
))
for
i
in
range
(
self
.
tables
):
tdSql
.
execute
(
"create table tb%d using stb1 tags(%d)"
%
(
i
,
i
))
sql
=
"insert into tb%d values"
%
i
for
j
in
range
(
self
.
rows
):
sql
+=
"(%d, %d, %f, '%s')"
%
(
self
.
ts
+
j
,
random
.
randint
(
1
,
1000
),
random
.
uniform
(
0
,
10
),
str
)
tdSql
.
execute
(
sql
)
def
query_check
(
self
):
tdSql
.
query
(
"select * from stb1 limit 1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select count(*) from stb1 where c3 like 'test%'"
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
query
(
"select count(*) from stb1 where c3 like '__st%'"
)
tdSql
.
checkData
(
0
,
0
,
100
)
def
boundry_check
(
self
):
tdSql
.
error
(
"create table stb2(ts timestamp, c1 int, c2 float, c3 binary(65510)) tags(t1 int)"
)
tdSql
.
error
(
"create table stb3(ts timestamp, c1 int, c2 float, c3 nchar(16378)) tags(t1 int)"
)
def
run
(
self
):
self
.
prepare_data
()
self
.
query_check
()
self
.
boundry_check
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录