Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b1a1e49c
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看板
提交
b1a1e49c
编写于
12月 19, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feat/TS-2158
上级
09061bcc
c72c3472
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
2854 addition
and
2719 deletion
+2854
-2719
docs/zh/12-taos-sql/04-stable.md
docs/zh/12-taos-sql/04-stable.md
+2
-2
include/common/ttokendef.h
include/common/ttokendef.h
+60
-60
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+9
-1
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+2713
-2630
source/libs/tdb/src/db/tdbPCache.c
source/libs/tdb/src/db/tdbPCache.c
+27
-1
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+1
-0
source/libs/tdb/src/inc/tdbInt.h
source/libs/tdb/src/inc/tdbInt.h
+2
-0
tests/system-test/2-query/leastsquares.py
tests/system-test/2-query/leastsquares.py
+40
-25
未找到文件。
docs/zh/12-taos-sql/04-stable.md
浏览文件 @
b1a1e49c
...
...
@@ -139,10 +139,10 @@ alter_table_option: {
-
ADD COLUMN:添加列。
-
DROP COLUMN:删除列。
-
MODIFY COLUMN:修改列
定义,如果数据列的类型是可变长类型,那么可以使用此指令
修改其宽度,只能改大,不能改小。
-
MODIFY COLUMN:修改列
的宽度,数据列的类型必须是 nchar 和 binary,使用此指令可以
修改其宽度,只能改大,不能改小。
-
ADD TAG:给超级表添加一个标签。
-
DROP TAG:删除超级表的一个标签。从超级表删除某个标签后,该超级表下的所有子表也会自动删除该标签。
-
MODIFY TAG:修改超级表的一个标签的
定义。如果标签的类型是可变长类型,那么可以使用此指令
修改其宽度,只能改大,不能改小。
-
MODIFY TAG:修改超级表的一个标签的
列宽度。标签的类型只能是 nchar 和 binary,使用此指令可以
修改其宽度,只能改大,不能改小。
-
RENAME TAG:修改超级表的一个标签的名称。从超级表修改某个标签名后,该超级表下的所有子表也会自动更新该标签名。
### 增加列
...
...
include/common/ttokendef.h
浏览文件 @
b1a1e49c
...
...
@@ -182,66 +182,66 @@
#define TK_INDEX 164
#define TK_FUNCTION 165
#define TK_INTERVAL 166
#define TK_
TOPIC
167
#define TK_
WITH
168
#define TK_
META
169
#define TK_
CONSUMER
170
#define TK_
GROUP
171
#define TK_
DESC
172
#define TK_
DESCRIBE
173
#define TK_
RESET
174
#define TK_
QUERY
175
#define TK_
CACHE
176
#define TK_
EXPLAIN
177
#define TK_
ANALYZE
178
#define TK_
VERBOSE
179
#define TK_
NK_BOOL
180
#define TK_
RATIO
181
#define TK_NK_
FLOAT
182
#define TK_
OUTPUTTYPE
183
#define TK_
AGGREGATE
184
#define TK_
BUFSIZE
185
#define TK_
STREAM
186
#define TK_
INTO
187
#define TK_
TRIGGER
188
#define TK_
AT_ONCE
189
#define TK_
WINDOW_CLOSE
190
#define TK_
IGNORE
191
#define TK_
EXPIRED
192
#define TK_
FILL_HISTORY
193
#define TK_
SUBTABLE
194
#define TK_
KILL
195
#define TK_
CONNECTION
196
#define TK_
TRANSACTION
197
#define TK_
BALANCE
198
#define TK_
VGROUP
199
#define TK_
MERGE
200
#define TK_
REDISTRIBUTE
201
#define TK_
SPLIT
202
#define TK_
DELETE
203
#define TK_
INSERT
204
#define TK_
NULL
205
#define TK_
NK_QUESTION
206
#define TK_N
K_ARROW
207
#define TK_
ROWTS
208
#define TK_
QSTART
209
#define TK_
QEND
210
#define TK_Q
DURATION
211
#define TK_
WSTART
212
#define TK_
WEND
213
#define TK_W
DURATION
214
#define TK_
IROWTS
215
#define TK_
ISFILLED
216
#define TK_
CAST
217
#define TK_
NOW
218
#define TK_
TODAY
219
#define TK_
TIMEZONE
220
#define TK_
CLIENT_VERSION
221
#define TK_
SERVER_VERSION
222
#define TK_
SERVER_STATUS
223
#define TK_
CURRENT_USER
224
#define TK_
COUNT
225
#define TK_
LAST_ROW
226
#define TK_
COUNT
167
#define TK_
LAST_ROW
168
#define TK_
TOPIC
169
#define TK_
WITH
170
#define TK_
META
171
#define TK_
CONSUMER
172
#define TK_
GROUP
173
#define TK_
DESC
174
#define TK_
DESCRIBE
175
#define TK_
RESET
176
#define TK_
QUERY
177
#define TK_
CACHE
178
#define TK_
EXPLAIN
179
#define TK_
ANALYZE
180
#define TK_
VERBOSE
181
#define TK_NK_
BOOL
182
#define TK_
RATIO
183
#define TK_
NK_FLOAT
184
#define TK_
OUTPUTTYPE
185
#define TK_
AGGREGATE
186
#define TK_
BUFSIZE
187
#define TK_
STREAM
188
#define TK_
INTO
189
#define TK_
TRIGGER
190
#define TK_
AT_ONCE
191
#define TK_
WINDOW_CLOSE
192
#define TK_
IGNORE
193
#define TK_
EXPIRED
194
#define TK_
FILL_HISTORY
195
#define TK_
SUBTABLE
196
#define TK_
KILL
197
#define TK_
CONNECTION
198
#define TK_
TRANSACTION
199
#define TK_
BALANCE
200
#define TK_
VGROUP
201
#define TK_
MERGE
202
#define TK_
REDISTRIBUTE
203
#define TK_
SPLIT
204
#define TK_
DELETE
205
#define TK_
INSERT
206
#define TK_N
ULL
207
#define TK_
NK_QUESTION
208
#define TK_
NK_ARROW
209
#define TK_
ROWTS
210
#define TK_Q
START
211
#define TK_
QEND
212
#define TK_
QDURATION
213
#define TK_W
START
214
#define TK_
WEND
215
#define TK_
WDURATION
216
#define TK_
IROWTS
217
#define TK_
ISFILLED
218
#define TK_
CAST
219
#define TK_
NOW
220
#define TK_
TODAY
221
#define TK_
TIMEZONE
222
#define TK_
CLIENT_VERSION
223
#define TK_
SERVER_VERSION
224
#define TK_
SERVER_STATUS
225
#define TK_
CURRENT_USER
226
#define TK_CASE 227
#define TK_END 228
#define TK_WHEN 229
...
...
source/libs/parser/inc/sql.y
浏览文件 @
b1a1e49c
...
...
@@ -473,7 +473,15 @@ index_options(A) ::= FUNCTION NK_LP func_list(B) NK_RP INTERVAL
func_list(A) ::= func(B). { A = createNodeList(pCxt, B); }
func_list(A) ::= func_list(B) NK_COMMA func(C). { A = addNodeToList(pCxt, B, C); }
func(A) ::= function_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); }
func(A) ::= sma_func_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); }
%type sma_func_name { SToken }
%destructor sma_func_name { }
sma_func_name(A) ::= function_name(B). { A = B; }
sma_func_name(A) ::= COUNT(B). { A = B; }
sma_func_name(A) ::= FIRST(B). { A = B; }
sma_func_name(A) ::= LAST(B). { A = B; }
sma_func_name(A) ::= LAST_ROW(B). { A = B; }
sma_stream_opt(A) ::= . { A = createStreamOptions(pCxt); }
sma_stream_opt(A) ::= sma_stream_opt(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; }
...
...
source/libs/parser/src/sql.c
浏览文件 @
b1a1e49c
此差异已折叠。
点击以展开。
source/libs/tdb/src/db/tdbPCache.c
浏览文件 @
b1a1e49c
...
...
@@ -192,6 +192,28 @@ SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn) {
return
pPage
;
}
void
tdbPCacheMarkFree
(
SPCache
*
pCache
,
SPage
*
pPage
)
{
tdbPCacheLock
(
pCache
);
tdbPCacheRemovePageFromHash
(
pCache
,
pPage
);
pPage
->
isFree
=
1
;
tdbPCacheUnlock
(
pCache
);
}
static
void
tdbPCacheFreePage
(
SPCache
*
pCache
,
SPage
*
pPage
)
{
if
(
pPage
->
id
<
pCache
->
nPages
)
{
pPage
->
pFreeNext
=
pCache
->
pFree
;
pCache
->
pFree
=
pPage
;
pPage
->
isFree
=
0
;
++
pCache
->
nFree
;
tdbTrace
(
"pcache/free page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
}
else
{
tdbTrace
(
"pcache destroy page: %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
tdbPCacheRemovePageFromHash
(
pCache
,
pPage
);
tdbPageDestroy
(
pPage
,
tdbDefaultFree
,
NULL
);
}
}
void
tdbPCacheRelease
(
SPCache
*
pCache
,
SPage
*
pPage
,
TXN
*
pTxn
)
{
i32
nRef
;
...
...
@@ -209,7 +231,11 @@ void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) {
// nRef = tdbGetPageRef(pPage);
// if (nRef == 0) {
if
(
pPage
->
isLocal
)
{
tdbPCacheUnpinPage
(
pCache
,
pPage
);
if
(
!
pPage
->
isFree
)
{
tdbPCacheUnpinPage
(
pCache
,
pPage
);
}
else
{
tdbPCacheFreePage
(
pCache
,
pPage
);
}
}
else
{
if
(
TDB_TXN_IS_WRITE
(
pTxn
))
{
// remove from hash
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
b1a1e49c
...
...
@@ -524,6 +524,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
hashset_remove
(
pTxn
->
jPageSet
,
(
void
*
)((
long
)
TDB_PAGE_PGNO
(
pPage
)));
tdbPCacheMarkFree
(
pPager
->
pCache
,
pPage
);
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
}
...
...
source/libs/tdb/src/inc/tdbInt.h
浏览文件 @
b1a1e49c
...
...
@@ -205,6 +205,7 @@ int tdbPagerRollback(SPager *pPager);
u8 isAnchor; \
u8 isLocal; \
u8 isDirty; \
u8 isFree; \
volatile i32 nRef; \
i32 id; \
SPage *pFreeNext; \
...
...
@@ -222,6 +223,7 @@ int tdbPCacheClose(SPCache *pCache);
int
tdbPCacheAlter
(
SPCache
*
pCache
,
int32_t
nPage
);
SPage
*
tdbPCacheFetch
(
SPCache
*
pCache
,
const
SPgid
*
pPgid
,
TXN
*
pTxn
);
void
tdbPCacheRelease
(
SPCache
*
pCache
,
SPage
*
pPage
,
TXN
*
pTxn
);
void
tdbPCacheMarkFree
(
SPCache
*
pCache
,
SPage
*
pPage
);
int
tdbPCacheGetPageSize
(
SPCache
*
pCache
);
// tdbPage.c ====================================
...
...
tests/system-test/2-query/leastsquares.py
浏览文件 @
b1a1e49c
...
...
@@ -19,12 +19,17 @@ BINARY_COL = "c8"
NCHAR_COL
=
"c9"
TS_COL
=
"c10"
NUM_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
]
UINT_COL
=
"c11"
UBINT_COL
=
"c12"
USINT_COL
=
"c13"
UTINT_COL
=
"c14"
NUM_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
UINT_COL
,
UBINT_COL
,
USINT_COL
,
UTINT_COL
]
CHAR_COL
=
[
BINARY_COL
,
NCHAR_COL
,
]
BOOLEAN_COL
=
[
BOOL_COL
,
]
TS_TYPE_COL
=
[
TS_COL
,
]
ALL_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
BOOL_COL
,
BINARY_COL
,
NCHAR_COL
,
TS_COL
]
ALL_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
BOOL_COL
,
BINARY_COL
,
NCHAR_COL
,
TS_COL
,
UINT_COL
,
UBINT_COL
,
USINT_COL
,
UTINT_COL
]
DBNAME
=
"db"
class
TDTestCase
:
...
...
@@ -208,6 +213,13 @@ class TDTestCase:
tdLog
.
info
(
f
"sql:
{
current_sqls
[
i
]
}
"
)
tdSql
.
query
(
current_sqls
[
i
])
def
check_result
(
self
):
for
col
in
NUM_COL
:
tdSql
.
query
(
"select leastsquares(%s, 1, 9) from %s.stb1"
%
(
col
,
DBNAME
))
tdSql
.
checkRows
(
1
)
res
=
tdSql
.
getData
(
0
,
0
)
if
res
is
None
:
tdLog
.
exit
(
"result is not correct"
)
def
__test_current
(
self
):
# tdSql.query("explain select c1 from {dbname}.ct1")
...
...
@@ -236,6 +248,7 @@ class TDTestCase:
def
all_test
(
self
):
self
.
__test_error
()
self
.
__test_current
()
self
.
check_result
()
def
__create_tb
(
self
,
dbname
=
DBNAME
):
...
...
@@ -243,13 +256,15 @@ class TDTestCase:
create_stb_sql
=
f
'''create table
{
dbname
}
.stb1(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp,
{
UINT_COL
}
int unsigned,
{
UBINT_COL
}
bigint unsigned,
{
USINT_COL
}
smallint unsigned,
{
UTINT_COL
}
tinyint unsigned
) tags (t1 int)
'''
create_ntb_sql
=
f
'''create table
{
dbname
}
.nt1(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp,
{
UINT_COL
}
int unsigned,
{
UBINT_COL
}
bigint unsigned,
{
USINT_COL
}
smallint unsigned,
{
UTINT_COL
}
tinyint unsigned
)
'''
tdSql
.
execute
(
create_stb_sql
)
...
...
@@ -262,49 +277,49 @@ class TDTestCase:
now_time
=
int
(
datetime
.
datetime
.
timestamp
(
datetime
.
datetime
.
now
())
*
1000
)
for
i
in
range
(
rows
):
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ct1 values (
{
now_time
-
i
*
1000
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
,
{
1.11
*
i
}
,
{
1100.0011
*
i
}
,
{
i
%
2
}
, 'binary
{
i
}
', 'nchar_测试_
{
i
}
',
{
now_time
+
1
*
i
}
)"
f
"insert into
{
dbname
}
.ct1 values (
{
now_time
-
i
*
1000
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
,
{
1.11
*
i
}
,
{
1100.0011
*
i
}
,
{
i
%
2
}
, 'binary
{
i
}
', 'nchar_测试_
{
i
}
',
{
now_time
+
1
*
i
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ct4 values (
{
now_time
-
i
*
7776000000
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
,
{
1.11
*
i
}
,
{
1100.0011
*
i
}
,
{
i
%
2
}
, 'binary
{
i
}
', 'nchar_测试_
{
i
}
',
{
now_time
+
1
*
i
}
)"
f
"insert into
{
dbname
}
.ct4 values (
{
now_time
-
i
*
7776000000
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
,
{
1.11
*
i
}
,
{
1100.0011
*
i
}
,
{
i
%
2
}
, 'binary
{
i
}
', 'nchar_测试_
{
i
}
',
{
now_time
+
1
*
i
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ct2 values (
{
now_time
-
i
*
7776000000
}
,
{
-
i
}
,
{
-
11111
*
i
}
,
{
-
111
*
i
%
32767
}
,
{
-
11
*
i
%
127
}
,
{
-
1.11
*
i
}
,
{
-
1100.0011
*
i
}
,
{
i
%
2
}
, 'binary
{
i
}
', 'nchar_测试_
{
i
}
',
{
now_time
+
1
*
i
}
)"
f
"insert into
{
dbname
}
.ct2 values (
{
now_time
-
i
*
7776000000
}
,
{
-
i
}
,
{
-
11111
*
i
}
,
{
-
111
*
i
%
32767
}
,
{
-
11
*
i
%
127
}
,
{
-
1.11
*
i
}
,
{
-
1100.0011
*
i
}
,
{
i
%
2
}
, 'binary
{
i
}
', 'nchar_测试_
{
i
}
',
{
now_time
+
1
*
i
}
,
{
i
}
,
{
11111
*
i
}
,
{
111
*
i
%
32767
}
,
{
11
*
i
%
127
}
)"
)
tdSql
.
execute
(
f
'''insert into
{
dbname
}
.ct1 values
(
{
now_time
-
rows
*
5
}
, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar_测试_0',
{
now_time
+
8
}
)
(
{
now_time
+
10000
}
,
{
rows
}
, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar_测试_9',
{
now_time
+
9
}
)
(
{
now_time
-
rows
*
5
}
, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar_测试_0',
{
now_time
+
8
}
, 0, 0, 0, 0
)
(
{
now_time
+
10000
}
,
{
rows
}
, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar_测试_9',
{
now_time
+
9
}
, 0, 0, 0, NULL
)
'''
)
tdSql
.
execute
(
f
'''insert into
{
dbname
}
.ct4 values
(
{
now_time
-
rows
*
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
-
rows
*
3888000000
+
10800000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
+
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
)
(
{
now_time
-
rows
*
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
-
rows
*
3888000000
+
10800000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
5184000000
}
,
{
pow
(
2
,
31
)
-
pow
(
2
,
15
)
}
,
{
pow
(
2
,
63
)
-
pow
(
2
,
30
)
}
, 32767, 127,
{
3.3
*
pow
(
10
,
38
)
}
,
{
1.3
*
pow
(
10
,
308
)
}
,
{
rows
%
2
}
, "binary_limit-1", "nchar_测试_limit-1",
{
now_time
-
86400000
}
{
3.3
*
pow
(
10
,
38
)
}
,
{
1.3
*
pow
(
10
,
308
)
}
,
{
rows
%
2
}
, "binary_limit-1", "nchar_测试_limit-1",
{
now_time
-
86400000
}
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
2592000000
}
,
{
pow
(
2
,
31
)
-
pow
(
2
,
16
)
}
,
{
pow
(
2
,
63
)
-
pow
(
2
,
31
)
}
, 32766, 126,
{
3.2
*
pow
(
10
,
38
)
}
,
{
1.2
*
pow
(
10
,
308
)
}
,
{
(
rows
-
1
)
%
2
}
, "binary_limit-2", "nchar_测试_limit-2",
{
now_time
-
172800000
}
{
3.2
*
pow
(
10
,
38
)
}
,
{
1.2
*
pow
(
10
,
308
)
}
,
{
(
rows
-
1
)
%
2
}
, "binary_limit-2", "nchar_测试_limit-2",
{
now_time
-
172800000
}
, NULL, NULL, NULL, NULL
)
'''
)
tdSql
.
execute
(
f
'''insert into
{
dbname
}
.ct2 values
(
{
now_time
-
rows
*
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
)
(
{
now_time
-
rows
*
3888000000
+
10800000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
+
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
-
rows
*
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
-
rows
*
3888000000
+
10800000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
7776000000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
5184000000
}
,
{
-
1
*
pow
(
2
,
31
)
+
pow
(
2
,
15
)
}
,
{
-
1
*
pow
(
2
,
63
)
+
pow
(
2
,
30
)
}
, -32766, -126,
{
-
1
*
3.2
*
pow
(
10
,
38
)
}
,
{
-
1.2
*
pow
(
10
,
308
)
}
,
{
rows
%
2
}
, "binary_limit-1", "nchar_测试_limit-1",
{
now_time
-
86400000
}
{
-
1
*
3.2
*
pow
(
10
,
38
)
}
,
{
-
1.2
*
pow
(
10
,
308
)
}
,
{
rows
%
2
}
, "binary_limit-1", "nchar_测试_limit-1",
{
now_time
-
86400000
}
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
2592000000
}
,
{
-
1
*
pow
(
2
,
31
)
+
pow
(
2
,
16
)
}
,
{
-
1
*
pow
(
2
,
63
)
+
pow
(
2
,
31
)
}
, -32767, -127,
{
-
3.3
*
pow
(
10
,
38
)
}
,
{
-
1.3
*
pow
(
10
,
308
)
}
,
{
(
rows
-
1
)
%
2
}
, "binary_limit-2", "nchar_测试_limit-2",
{
now_time
-
172800000
}
{
-
3.3
*
pow
(
10
,
38
)
}
,
{
-
1.3
*
pow
(
10
,
308
)
}
,
{
(
rows
-
1
)
%
2
}
, "binary_limit-2", "nchar_测试_limit-2",
{
now_time
-
172800000
}
, NULL, NULL, NULL, NULL
)
'''
)
...
...
@@ -312,22 +327,22 @@ class TDTestCase:
for
i
in
range
(
rows
):
insert_data
=
f
'''insert into
{
dbname
}
.nt1 values
(
{
now_time
-
i
*
3600000
}
,
{
i
}
,
{
i
*
11111
}
,
{
i
%
32767
}
,
{
i
%
127
}
,
{
i
*
1.11111
}
,
{
i
*
1000.1111
}
,
{
i
%
2
}
,
"binary_
{
i
}
", "nchar_测试_
{
i
}
",
{
now_time
-
1000
*
i
}
)
"binary_
{
i
}
", "nchar_测试_
{
i
}
",
{
now_time
-
1000
*
i
}
, NULL, NULL, NULL, NULL
)
'''
tdSql
.
execute
(
insert_data
)
tdSql
.
execute
(
f
'''insert into
{
dbname
}
.nt1 values
(
{
now_time
+
10800000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
-
((
rows
//
2
)
*
60
+
30
)
*
60000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
-
rows
*
3600000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
(
{
now_time
+
10800000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
-
((
rows
//
2
)
*
60
+
30
)
*
60000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
-
rows
*
3600000
}
, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
7200000
}
,
{
pow
(
2
,
31
)
-
pow
(
2
,
15
)
}
,
{
pow
(
2
,
63
)
-
pow
(
2
,
30
)
}
, 32767, 127,
{
3.3
*
pow
(
10
,
38
)
}
,
{
1.3
*
pow
(
10
,
308
)
}
,
{
rows
%
2
}
,
"binary_limit-1", "nchar_测试_limit-1",
{
now_time
-
86400000
}
"binary_limit-1", "nchar_测试_limit-1",
{
now_time
-
86400000
}
, NULL, NULL, NULL, NULL
)
(
{
now_time
+
3600000
}
,
{
pow
(
2
,
31
)
-
pow
(
2
,
16
)
}
,
{
pow
(
2
,
63
)
-
pow
(
2
,
31
)
}
, 32766, 126,
{
3.2
*
pow
(
10
,
38
)
}
,
{
1.2
*
pow
(
10
,
308
)
}
,
{
(
rows
-
1
)
%
2
}
,
"binary_limit-2", "nchar_测试_limit-2",
{
now_time
-
172800000
}
"binary_limit-2", "nchar_测试_limit-2",
{
now_time
-
172800000
}
, NULL, NULL, NULL, NULL
)
'''
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录