Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7c5419b4
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看板
提交
7c5419b4
编写于
7月 04, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix: increase the tag value overflow check when creating table
上级
57dae9fc
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
33 addition
and
18 deletion
+33
-18
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+5
-5
source/libs/parser/test/parInitialCTest.cpp
source/libs/parser/test/parInitialCTest.cpp
+15
-0
tests/system-test/2-query/abs.py
tests/system-test/2-query/abs.py
+1
-1
tests/system-test/2-query/distribute_agg_apercentile.py
tests/system-test/2-query/distribute_agg_apercentile.py
+1
-1
tests/system-test/2-query/distribute_agg_avg.py
tests/system-test/2-query/distribute_agg_avg.py
+1
-1
tests/system-test/2-query/distribute_agg_count.py
tests/system-test/2-query/distribute_agg_count.py
+1
-1
tests/system-test/2-query/distribute_agg_max.py
tests/system-test/2-query/distribute_agg_max.py
+1
-1
tests/system-test/2-query/distribute_agg_min.py
tests/system-test/2-query/distribute_agg_min.py
+1
-1
tests/system-test/2-query/distribute_agg_spread.py
tests/system-test/2-query/distribute_agg_spread.py
+1
-1
tests/system-test/2-query/distribute_agg_stddev.py
tests/system-test/2-query/distribute_agg_stddev.py
+1
-1
tests/system-test/2-query/distribute_agg_sum.py
tests/system-test/2-query/distribute_agg_sum.py
+1
-1
tests/system-test/2-query/function_null.py
tests/system-test/2-query/function_null.py
+1
-1
tests/system-test/2-query/irate.py
tests/system-test/2-query/irate.py
+1
-1
tests/system-test/2-query/max.py
tests/system-test/2-query/max.py
+1
-1
tests/system-test/2-query/twa.py
tests/system-test/2-query/twa.py
+1
-1
未找到文件。
source/libs/parser/src/parTranslater.c
浏览文件 @
7c5419b4
...
...
@@ -3300,8 +3300,8 @@ static int32_t checkTableTagsSchema(STranslateContext* pCxt, SHashObj* pHash, SN
code
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_ONE_JSON_TAG
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
((
TSDB_DATA_TYPE_VARCHAR
==
pTag
->
dataType
.
type
&&
pTag
->
dataType
.
bytes
>
TSDB_MAX_BINARY_LEN
)
||
(
TSDB_DATA_TYPE_NCHAR
==
pTag
->
dataType
.
type
&&
pTag
->
dataType
.
bytes
>
TSDB_MAX_NCHAR_LEN
))
{
if
((
TSDB_DATA_TYPE_VARCHAR
==
pTag
->
dataType
.
type
&&
calcTypeBytes
(
pTag
->
dataType
)
>
TSDB_MAX_BINARY_LEN
)
||
(
TSDB_DATA_TYPE_NCHAR
==
pTag
->
dataType
.
type
&&
calcTypeBytes
(
pTag
->
dataType
)
>
TSDB_MAX_NCHAR_LEN
))
{
code
=
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN
);
}
}
...
...
@@ -3322,11 +3322,11 @@ static int32_t checkTableTagsSchema(STranslateContext* pCxt, SHashObj* pHash, SN
return
code
;
}
static
int32_t
checkTableColsSchema
(
STranslateContext
*
pCxt
,
SHashObj
*
pHash
,
SNodeList
*
pCols
)
{
static
int32_t
checkTableColsSchema
(
STranslateContext
*
pCxt
,
SHashObj
*
pHash
,
int32_t
ntags
,
SNodeList
*
pCols
)
{
int32_t
ncols
=
LIST_LENGTH
(
pCols
);
if
(
ncols
<
TSDB_MIN_COLUMNS
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_COLUMNS_NUM
);
}
else
if
(
ncols
>
TSDB_MAX_COLUMNS
)
{
}
else
if
(
ncols
+
ntags
>
TSDB_MAX_COLUMNS
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_TOO_MANY_COLUMNS
);
}
...
...
@@ -3382,7 +3382,7 @@ static int32_t checkTableSchema(STranslateContext* pCxt, SCreateTableStmt* pStmt
int32_t
code
=
checkTableTagsSchema
(
pCxt
,
pHash
,
pStmt
->
pTags
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkTableColsSchema
(
pCxt
,
pHash
,
pStmt
->
pCols
);
code
=
checkTableColsSchema
(
pCxt
,
pHash
,
LIST_LENGTH
(
pStmt
->
pTags
),
pStmt
->
pCols
);
}
taosHashCleanup
(
pHash
);
...
...
source/libs/parser/test/parInitialCTest.cpp
浏览文件 @
7c5419b4
...
...
@@ -621,6 +621,21 @@ TEST_F(ParserInitialCTest, createTable) {
// run("CREATE TABLE IF NOT EXISTS t1 USING st1 TAGS(1, 'wxy', NOW + 1S)");
}
TEST_F
(
ParserInitialCTest
,
createTableSemanticCheck
)
{
useDb
(
"root"
,
"test"
);
string
sql
=
"CREATE TABLE st1(ts TIMESTAMP, "
;
for
(
int32_t
i
=
1
;
i
<
4096
;
++
i
)
{
if
(
i
>
1
)
{
sql
.
append
(
", "
);
}
sql
.
append
(
"c"
+
to_string
(
i
)
+
" INT"
);
}
sql
.
append
(
") TAGS (t1 int)"
);
run
(
sql
,
TSDB_CODE_PAR_TOO_MANY_COLUMNS
);
}
TEST_F
(
ParserInitialCTest
,
createTopic
)
{
useDb
(
"root"
,
"test"
);
...
...
tests/system-test/2-query/abs.py
浏览文件 @
7c5419b4
...
...
@@ -139,7 +139,7 @@ class TDTestCase:
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_apercentile.py
浏览文件 @
7c5419b4
...
...
@@ -36,7 +36,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_avg.py
浏览文件 @
7c5419b4
...
...
@@ -53,7 +53,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_count.py
浏览文件 @
7c5419b4
...
...
@@ -55,7 +55,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_max.py
浏览文件 @
7c5419b4
...
...
@@ -55,7 +55,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_min.py
浏览文件 @
7c5419b4
...
...
@@ -55,7 +55,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_spread.py
浏览文件 @
7c5419b4
...
...
@@ -55,7 +55,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_stddev.py
浏览文件 @
7c5419b4
...
...
@@ -64,7 +64,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/distribute_agg_sum.py
浏览文件 @
7c5419b4
...
...
@@ -53,7 +53,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/function_null.py
浏览文件 @
7c5419b4
...
...
@@ -42,7 +42,7 @@ class TDTestCase:
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/irate.py
浏览文件 @
7c5419b4
...
...
@@ -97,7 +97,7 @@ class TDTestCase:
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/max.py
浏览文件 @
7c5419b4
...
...
@@ -109,7 +109,7 @@ class TDTestCase:
'''
)
for
i
in
range
(
20
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
for
i
in
range
(
9
):
tdSql
.
execute
(
...
...
tests/system-test/2-query/twa.py
浏览文件 @
7c5419b4
...
...
@@ -34,7 +34,7 @@ class TDTestCase:
)
for
i
in
range
(
self
.
tb_nums
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags ( now(),
{
1
*
i
}
,
{
11111
*
i
}
,
{
111
*
i
}
,
{
1
*
i
}
,
{
1.11
*
i
}
,
{
11.11
*
i
}
,
{
i
%
2
}
, "binary
{
i
}
", "nchar
{
i
}
" )'
)
ts
=
self
.
ts
for
j
in
range
(
self
.
row_nums
):
ts
+=
j
*
self
.
time_step
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录