Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
8bf4ef21
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8bf4ef21
编写于
5月 23, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix td-317: max table name length now is 392
上级
f398488a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
8 deletion
+37
-8
src/common/src/tname.c
src/common/src/tname.c
+1
-0
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+2
-2
tests/pytest/table/boundary.py
tests/pytest/table/boundary.py
+31
-6
tests/pytest/util/sql.py
tests/pytest/util/sql.py
+3
-0
未找到文件。
src/common/src/tname.c
浏览文件 @
8bf4ef21
...
@@ -29,6 +29,7 @@ void extractTableName(const char* tableId, char* name) {
...
@@ -29,6 +29,7 @@ void extractTableName(const char* tableId, char* name) {
size_t
s2
=
strcspn
(
&
tableId
[
s1
+
1
],
&
TS_PATH_DELIMITER
[
0
]);
size_t
s2
=
strcspn
(
&
tableId
[
s1
+
1
],
&
TS_PATH_DELIMITER
[
0
]);
strncpy
(
name
,
&
tableId
[
s1
+
s2
+
2
],
TSDB_TABLE_NAME_LEN
);
strncpy
(
name
,
&
tableId
[
s1
+
s2
+
2
],
TSDB_TABLE_NAME_LEN
);
name
[
TSDB_TABLE_NAME_LEN
]
=
0
;
}
}
char
*
extractDBName
(
const
char
*
tableId
,
char
*
name
)
{
char
*
extractDBName
(
const
char
*
tableId
,
char
*
name
)
{
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
8bf4ef21
...
@@ -1139,7 +1139,7 @@ int32_t mgmtRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows, v
...
@@ -1139,7 +1139,7 @@ int32_t mgmtRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows, v
prefixLen
=
strlen
(
prefix
);
prefixLen
=
strlen
(
prefix
);
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
char
stableName
[
TSDB_TABLE_NAME_LEN
]
=
{
0
};
char
stableName
[
TSDB_TABLE_NAME_LEN
+
1
]
=
{
0
};
while
(
numOfRows
<
rows
)
{
while
(
numOfRows
<
rows
)
{
pShow
->
pIter
=
mgmtGetNextSuperTable
(
pShow
->
pIter
,
&
pTable
);
pShow
->
pIter
=
mgmtGetNextSuperTable
(
pShow
->
pIter
,
&
pTable
);
...
@@ -2148,7 +2148,7 @@ static int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows,
...
@@ -2148,7 +2148,7 @@ static int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows,
continue
;
continue
;
}
}
char
tableName
[
TSDB_TABLE_NAME_LEN
]
=
{
0
};
char
tableName
[
TSDB_TABLE_NAME_LEN
+
1
]
=
{
0
};
// pattern compare for table name
// pattern compare for table name
mgmtExtractTableName
(
pTable
->
info
.
tableId
,
tableName
);
mgmtExtractTableName
(
pTable
->
info
.
tableId
,
tableName
);
...
...
tests/pytest/table/boundary.py
浏览文件 @
8bf4ef21
...
@@ -10,7 +10,7 @@ from util.sql import *
...
@@ -10,7 +10,7 @@ from util.sql import *
class
TDTestCase
:
class
TDTestCase
:
def
init
(
self
,
conn
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
...
@@ -95,18 +95,43 @@ class TDTestCase:
...
@@ -95,18 +95,43 @@ class TDTestCase:
maxTableNameLen
=
self
.
getLimitFromSourceCode
(
'TSDB_TABLE_NAME_LEN'
)
maxTableNameLen
=
self
.
getLimitFromSourceCode
(
'TSDB_TABLE_NAME_LEN'
)
tdLog
.
notice
(
"table name max length is %d"
%
maxTableNameLen
)
tdLog
.
notice
(
"table name max length is %d"
%
maxTableNameLen
)
name
=
self
.
generateString
(
maxTableNameLen
-
1
)
# create a super table with name exceed max length
tdLog
.
info
(
"table name is '%s'"
%
name
)
sname
=
self
.
generateString
(
maxTableNameLen
+
1
)
tdLog
.
info
(
"create a super table with length %d"
%
len
(
sname
))
tdSql
.
error
(
"create table %s (ts timestamp, value int) tags(id int)"
%
sname
)
tdSql
.
execute
(
"create table %s (ts timestamp, value int)"
%
name
)
# create a super table with name of max length
tdSql
.
execute
(
"insert into %s values(now, 0)"
%
name
)
sname
=
self
.
generateString
(
maxTableNameLen
)
tdLog
.
info
(
"create a super table with length %d"
%
len
(
sname
))
tdSql
.
execute
(
"create table %s (ts timestamp, value int) tags(id int)"
%
sname
)
tdLog
.
info
(
"check table count, should be one"
)
tdSql
.
query
(
'show stables'
)
tdSql
.
checkRows
(
1
)
# create a child table with name exceed max length
name
=
self
.
generateString
(
maxTableNameLen
+
1
)
tdLog
.
info
(
"create a child table with length %d"
%
len
(
name
))
tdSql
.
error
(
"create table %s using %s tags(0)"
%
(
name
,
sname
))
# create a child table with name of max length
name
=
self
.
generateString
(
maxTableNameLen
)
tdLog
.
info
(
"create a child table with length %d"
%
len
(
name
))
tdSql
.
execute
(
"create table %s using %s tags(0)"
%
(
name
,
sname
))
tdSql
.
query
(
'show tables'
)
tdSql
.
query
(
'show tables'
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
'select * from %s'
%
name
)
# insert one row
tdLog
.
info
(
"insert one row of data"
)
tdSql
.
execute
(
"insert into %s values(now, 0)"
%
name
)
tdSql
.
query
(
"select * from "
+
name
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from "
+
sname
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
name
=
name
[:
len
(
name
)
-
1
]
tdSql
.
error
(
"select * from "
+
name
)
tdSql
.
checkRows
(
0
)
def
checkRowBoundaries
(
self
):
def
checkRowBoundaries
(
self
):
tdLog
.
debug
(
"checking row boundaries"
)
tdLog
.
debug
(
"checking row boundaries"
)
tdSql
.
prepare
()
tdSql
.
prepare
()
...
...
tests/pytest/util/sql.py
浏览文件 @
8bf4ef21
...
@@ -58,6 +58,9 @@ class TDSql:
...
@@ -58,6 +58,9 @@ class TDSql:
"%s failed: sql:%s, expect error not occured"
%
"%s failed: sql:%s, expect error not occured"
%
(
callerFilename
,
sql
))
(
callerFilename
,
sql
))
else
:
else
:
self
.
queryRows
=
0
self
.
queryCols
=
0
self
.
queryResult
=
None
tdLog
.
info
(
"sql:%s, expect error occured"
%
(
sql
))
tdLog
.
info
(
"sql:%s, expect error occured"
%
(
sql
))
def
query
(
self
,
sql
):
def
query
(
self
,
sql
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录