Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
512551b1
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看板
未验证
提交
512551b1
编写于
4月 23, 2021
作者:
W
wu champion
提交者:
GitHub
4月 23, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into test/TD-3918
上级
369c9a76
61d373e2
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
503 addition
and
20 deletion
+503
-20
cmake/define.inc
cmake/define.inc
+6
-5
src/os/inc/os.h
src/os/inc/os.h
+4
-0
src/os/inc/osMips64.h
src/os/inc/osMips64.h
+87
-0
src/util/src/tcrc32c.c
src/util/src/tcrc32c.c
+4
-4
tests/examples/go/taosdemo.go
tests/examples/go/taosdemo.go
+148
-2
tests/perftest-scripts/perftest-query.sh
tests/perftest-scripts/perftest-query.sh
+1
-1
tests/pytest/alter/alterTimestampColDataProcess.py
tests/pytest/alter/alterTimestampColDataProcess.py
+73
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+6
-0
tests/pytest/query/queryFilterTswithDateUnit.py
tests/pytest/query/queryFilterTswithDateUnit.py
+166
-0
tests/test-all.sh
tests/test-all.sh
+8
-8
未找到文件。
cmake/define.inc
浏览文件 @
512551b1
...
...
@@ -69,7 +69,6 @@ IF (TD_LINUX_32)
ENDIF
()
IF
(
TD_ARM_64
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_ARM_64
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
...
...
@@ -86,17 +85,19 @@ IF (TD_ARM_32)
ENDIF
()
IF
(
TD_MIPS_64
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64_
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"mips64 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -
gdwarf-2 -msse4.2
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -
fsigned-char -fpack-struct=8
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
IF
(
TD_MIPS_32
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_32_
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_32
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"mips32 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -
gdwarf-2 -msse4.2 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
IF
(
TD_APLHINE
)
...
...
src/os/inc/os.h
浏览文件 @
512551b1
...
...
@@ -32,6 +32,10 @@ extern "C" {
#include "osArm32.h"
#endif
#ifdef _TD_MIPS_64
#include "osMips64.h"
#endif
#ifdef _TD_LINUX_64
#include "osLinux64.h"
#endif
...
...
src/os/inc/osMips64.h
0 → 100644
浏览文件 @
512551b1
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_OS_MIPS64_H
#define TDENGINE_OS_MIPS64_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <argp.h>
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <float.h>
#include <ifaddrs.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <pthread.h>
#include <pwd.h>
#include <regex.h>
#include <semaphore.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/sendfile.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/statvfs.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <syslog.h>
#include <termios.h>
#include <unistd.h>
#include <wchar.h>
#include <wordexp.h>
#include <wctype.h>
#include <inttypes.h>
#include <fcntl.h>
#include <sys/utsname.h>
#include <sys/resource.h>
#include <error.h>
#include <linux/sysctl.h>
#include <math.h>
#include <poll.h>
#ifdef __cplusplus
}
#endif
#endif
src/util/src/tcrc32c.c
浏览文件 @
512551b1
...
...
@@ -736,7 +736,7 @@ static uint32_t table[16][256] = {
0x9c221d09
,
0x6e2e10f7
,
0x7dd67004
,
0x8fda7dfa
}
};
#if
ndef _TD_ARM_
#if
!defined(_TD_ARM_) && !defined(_TD_MIPS_)
static
uint32_t
long_shifts
[
4
][
256
]
=
{
{
0x00000000
,
0xe040e0ac
,
0xc56db7a9
,
0x252d5705
,
0x8f3719a3
,
0x6f77f90f
,
0x4a5aae0a
,
0xaa1a4ea6
,
0x1b8245b7
,
0xfbc2a51b
,
0xdeeff21e
,
0x3eaf12b2
,
...
...
@@ -1187,7 +1187,7 @@ uint32_t crc32c_sf(uint32_t crci, crc_stream input, size_t length) {
}
return
(
uint32_t
)
crc
^
0xffffffff
;
}
#if
ndef _TD_ARM_
#if
!defined(_TD_ARM_) && !defined(_TD_MIPS_)
/* Apply the zeros operator table to crc. */
static
uint32_t
shift_crc
(
uint32_t
shift_table
[][
256
],
uint32_t
crc
)
{
return
shift_table
[
0
][
crc
&
0xff
]
^
shift_table
[
1
][(
crc
>>
8
)
&
0xff
]
^
...
...
@@ -1198,7 +1198,7 @@ static uint32_t shift_crc(uint32_t shift_table[][256], uint32_t crc) {
version. Otherwise, use the software version. */
uint32_t
(
*
crc32c
)(
uint32_t
crci
,
crc_stream
bytes
,
size_t
len
)
=
crc32c_sf
;
#if
ndef _TD_ARM_
#if
!defined(_TD_ARM_) && !defined(_TD_MIPS_)
/* Compute CRC-32C using the Intel hardware instruction. */
uint32_t
crc32c_hw
(
uint32_t
crc
,
crc_stream
buf
,
size_t
len
)
{
crc_stream
next
=
buf
;
...
...
@@ -1353,7 +1353,7 @@ uint32_t crc32c_hw(uint32_t crc, crc_stream buf, size_t len) {
#endif // #ifndef _TD_ARM_
void
taosResolveCRC
()
{
#if defined _TD_ARM_ || defined WINDOWS
#if defined _TD_ARM_ || defined
_TD_MIPS_ || defined
WINDOWS
crc32c
=
crc32c_sf
;
#else
int
sse42
;
...
...
tests/examples/go/taosdemo.go
浏览文件 @
512551b1
...
...
@@ -18,6 +18,7 @@ import (
"database/sql"
"flag"
"fmt"
"log"
"math/rand"
"os"
"runtime"
...
...
@@ -26,8 +27,6 @@ import (
"time"
_
"github.com/taosdata/driver-go/taosSql"
//"golang.org/x/sys/unix"
)
const
(
...
...
@@ -48,6 +47,7 @@ type config struct {
dbName
string
supTblName
string
tablePrefix
string
mode
string
numOftables
int
numOfRecordsPerTable
int
numOfRecordsPerReq
int
...
...
@@ -70,6 +70,7 @@ func init() {
flag
.
StringVar
(
&
configPara
.
password
,
"P"
,
"taosdata"
,
"The password to use when connecting to the server."
)
flag
.
StringVar
(
&
configPara
.
dbName
,
"d"
,
"test"
,
"Destination database."
)
flag
.
StringVar
(
&
configPara
.
tablePrefix
,
"m"
,
"d"
,
"Table prefix name."
)
flag
.
StringVar
(
&
configPara
.
mode
,
"M"
,
"r"
,
"mode,r:raw,s:stmt"
)
flag
.
IntVar
(
&
configPara
.
numOftables
,
"t"
,
2
,
"The number of tables."
)
flag
.
IntVar
(
&
configPara
.
numOfRecordsPerTable
,
"n"
,
10
,
"The number of records per table."
)
flag
.
IntVar
(
&
configPara
.
numOfRecordsPerReq
,
"r"
,
3
,
"The number of records per request."
)
...
...
@@ -94,6 +95,7 @@ func printAllArgs() {
fmt
.
Printf
(
"usr: %v
\n
"
,
configPara
.
user
)
fmt
.
Printf
(
"password: %v
\n
"
,
configPara
.
password
)
fmt
.
Printf
(
"dbName: %v
\n
"
,
configPara
.
dbName
)
fmt
.
Printf
(
"mode: %v
\n
"
,
configPara
.
mode
)
fmt
.
Printf
(
"tablePrefix: %v
\n
"
,
configPara
.
tablePrefix
)
fmt
.
Printf
(
"numOftables: %v
\n
"
,
configPara
.
numOftables
)
fmt
.
Printf
(
"numOfRecordsPerTable: %v
\n
"
,
configPara
.
numOfRecordsPerTable
)
...
...
@@ -119,6 +121,24 @@ func main() {
//defer db.Close()
rand
.
Seed
(
time
.
Now
()
.
Unix
())
if
configPara
.
mode
==
"s"
{
fmt
.
Printf
(
"
\n
======== start stmt mode test ========
\n
"
)
db
,
err
:=
sql
.
Open
(
"taosSql"
,
url
)
if
err
!=
nil
{
log
.
Fatalf
(
"Open database error: %s
\n
"
,
err
)
}
defer
db
.
Close
()
demodbStmt
:=
configPara
.
dbName
demotStmt
:=
"demotStmt"
drop_database_stmt
(
db
,
demodbStmt
)
create_database_stmt
(
db
,
demodbStmt
)
use_database_stmt
(
db
,
demodbStmt
)
create_table_stmt
(
db
,
demotStmt
)
insert_data_stmt
(
db
,
demotStmt
)
select_data_stmt
(
db
,
demotStmt
)
return
}
createDatabase
(
configPara
.
dbName
,
configPara
.
supTblName
)
fmt
.
Printf
(
"======== create database success! ========
\n\n
"
)
...
...
@@ -407,6 +427,132 @@ func selectTest(dbName string, tbPrefix string, supTblName string) {
checkErr
(
err
,
"rows next iteration error"
)
}
}
func
drop_database_stmt
(
db
*
sql
.
DB
,
demodb
string
)
{
st
:=
time
.
Now
()
.
Nanosecond
()
// drop test db
res
,
err
:=
db
.
Exec
(
"drop database if exists "
+
demodb
)
checkErr
(
err
,
"drop database "
+
demodb
)
affectd
,
err
:=
res
.
RowsAffected
()
checkErr
(
err
,
"drop db, res.RowsAffected"
)
et
:=
time
.
Now
()
.
Nanosecond
()
fmt
.
Printf
(
"drop database result:
\n
%d row(s) affectd (%6.6fs)
\n\n
"
,
affectd
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
create_database_stmt
(
db
*
sql
.
DB
,
demodb
string
)
{
st
:=
time
.
Now
()
.
Nanosecond
()
// create database
//var stmt interface{}
stmt
,
err
:=
db
.
Prepare
(
"create database ?"
)
checkErr
(
err
,
"create db, db.Prepare"
)
//var res driver.Result
res
,
err
:=
stmt
.
Exec
(
demodb
)
checkErr
(
err
,
"create db, stmt.Exec"
)
//fmt.Printf("Query OK, %d row(s) affected()", res.RowsAffected())
affectd
,
err
:=
res
.
RowsAffected
()
checkErr
(
err
,
"create db, res.RowsAffected"
)
et
:=
time
.
Now
()
.
Nanosecond
()
fmt
.
Printf
(
"create database result:
\n
%d row(s) affectd (%6.6fs)
\n\n
"
,
affectd
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
use_database_stmt
(
db
*
sql
.
DB
,
demodb
string
)
{
st
:=
time
.
Now
()
.
Nanosecond
()
// create database
//var stmt interface{}
stmt
,
err
:=
db
.
Prepare
(
"use "
+
demodb
)
checkErr
(
err
,
"use db, db.Prepare"
)
res
,
err
:=
stmt
.
Exec
()
checkErr
(
err
,
"use db, stmt.Exec"
)
affectd
,
err
:=
res
.
RowsAffected
()
checkErr
(
err
,
"use db, res.RowsAffected"
)
et
:=
time
.
Now
()
.
Nanosecond
()
fmt
.
Printf
(
"use database result:
\n
%d row(s) affectd (%6.6fs)
\n\n
"
,
affectd
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
create_table_stmt
(
db
*
sql
.
DB
,
demot
string
)
{
st
:=
time
.
Now
()
.
Nanosecond
()
// create table
// (ts timestamp, id int, name binary(8), len tinyint, flag bool, notes binary(8), fv float, dv double)
stmt
,
err
:=
db
.
Prepare
(
"create table ? (? timestamp, ? int, ? binary(10), ? tinyint, ? bool, ? binary(8), ? float, ? double)"
)
checkErr
(
err
,
"create table db.Prepare"
)
res
,
err
:=
stmt
.
Exec
(
demot
,
"ts"
,
"id"
,
"name"
,
"len"
,
"flag"
,
"notes"
,
"fv"
,
"dv"
)
checkErr
(
err
,
"create table stmt.Exec"
)
affectd
,
err
:=
res
.
RowsAffected
()
checkErr
(
err
,
"create table res.RowsAffected"
)
et
:=
time
.
Now
()
.
Nanosecond
()
fmt
.
Printf
(
"create table result:
\n
%d row(s) affectd (%6.6fs)
\n\n
"
,
affectd
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
insert_data_stmt
(
db
*
sql
.
DB
,
demot
string
)
{
st
:=
time
.
Now
()
.
Nanosecond
()
// insert data into table
stmt
,
err
:=
db
.
Prepare
(
"insert into ? values(?, ?, ?, ?, ?, ?, ?, ?) (?, ?, ?, ?, ?, ?, ?, ?) (?, ?, ?, ?, ?, ?, ?, ?)"
)
checkErr
(
err
,
"insert db.Prepare"
)
res
,
err
:=
stmt
.
Exec
(
demot
,
"now"
,
1000
,
"'haidian'"
,
6
,
true
,
"'AI world'"
,
6987.654
,
321.987
,
"now+1s"
,
1001
,
"'changyang'"
,
7
,
false
,
"'DeepMode'"
,
12356.456
,
128634.456
,
"now+2s"
,
1002
,
"'chuangping'"
,
8
,
true
,
"'database'"
,
3879.456
,
65433478.456
)
checkErr
(
err
,
"insert data, stmt.Exec"
)
affectd
,
err
:=
res
.
RowsAffected
()
checkErr
(
err
,
"res.RowsAffected"
)
et
:=
time
.
Now
()
.
Nanosecond
()
fmt
.
Printf
(
"insert data result:
\n
%d row(s) affectd (%6.6fs)
\n\n
"
,
affectd
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
select_data_stmt
(
db
*
sql
.
DB
,
demot
string
)
{
st
:=
time
.
Now
()
.
Nanosecond
()
stmt
,
err
:=
db
.
Prepare
(
"select ?, ?, ?, ?, ?, ?, ?, ? from ?"
)
// go binary mode
checkErr
(
err
,
"db.Prepare"
)
rows
,
err
:=
stmt
.
Query
(
"ts"
,
"id"
,
"name"
,
"len"
,
"flag"
,
"notes"
,
"fv"
,
"dv"
,
demot
)
checkErr
(
err
,
"stmt.Query"
)
fmt
.
Printf
(
"%10s%s%8s %5s %8s%s %s %10s%s %7s%s %8s%s %11s%s %14s%s
\n
"
,
" "
,
"ts"
,
" "
,
"id"
,
" "
,
"name"
,
" "
,
"len"
,
" "
,
"flag"
,
" "
,
"notes"
,
" "
,
"fv"
,
" "
,
" "
,
"dv"
)
var
affectd
int
for
rows
.
Next
()
{
var
ts
string
var
name
string
var
id
int
var
len
int8
var
flag
bool
var
notes
string
var
fv
float32
var
dv
float64
err
=
rows
.
Scan
(
&
ts
,
&
id
,
&
name
,
&
len
,
&
flag
,
&
notes
,
&
fv
,
&
dv
)
//fmt.Println("start scan fields from row.rs, &fv:", &fv)
//err = rows.Scan(&fv)
checkErr
(
err
,
"rows.Scan"
)
fmt
.
Printf
(
"%s
\t
"
,
ts
)
fmt
.
Printf
(
"%d
\t
"
,
id
)
fmt
.
Printf
(
"%10s
\t
"
,
name
)
fmt
.
Printf
(
"%d
\t
"
,
len
)
fmt
.
Printf
(
"%t
\t
"
,
flag
)
fmt
.
Printf
(
"%s
\t
"
,
notes
)
fmt
.
Printf
(
"%06.3f
\t
"
,
fv
)
fmt
.
Printf
(
"%09.6f
\n
"
,
dv
)
affectd
++
}
et
:=
time
.
Now
()
.
Nanosecond
()
fmt
.
Printf
(
"insert data result:
\n
%d row(s) affectd (%6.6fs)
\n\n
"
,
affectd
,
(
float32
(
et
-
st
))
/
1e9
)
}
func
checkErr
(
err
error
,
prompt
string
)
{
if
err
!=
nil
{
fmt
.
Printf
(
"%s
\n
"
,
prompt
)
...
...
tests/perftest-scripts/perftest-query.sh
浏览文件 @
512551b1
...
...
@@ -64,7 +64,7 @@ function runQueryPerfTest {
[
-f
$PERFORMANCE_TEST_REPORT
]
&&
rm
$PERFORMANCE_TEST_REPORT
nohup
$WORK_DIR
/TDengine/debug/build/bin/taosd
-c
/etc/taosperf/
>
/dev/null 2>&1 &
echoInfo
"Wait TDengine to start"
sleep
12
0
sleep
30
0
echoInfo
"Run Performance Test"
cd
$WORK_DIR
/TDengine/tests/pytest
...
...
tests/pytest/alter/alterTimestampColDataProcess.py
0 → 100644
浏览文件 @
512551b1
###################################################################
# Copyright (c) 2016 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.dnodes
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to execute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db keep 36500"
)
tdSql
.
execute
(
"use db"
)
tdLog
.
printNoPrefix
(
"==========step1:create table && insert data"
)
# timestamp list:
# 0 -> "1970-01-01 08:00:00" | -28800000 -> "1970-01-01 00:00:00" | -946800000000 -> "1940-01-01 00:00:00"
# -631180800000 -> "1950-01-01 00:00:00"
ts1
=
0
ts2
=
-
28800000
ts3
=
-
946800000000
ts4
=
"1950-01-01 00:00:00"
tdSql
.
execute
(
"create table stb2ts (ts timestamp, ts1 timestamp, ts2 timestamp, c1 int, ts3 timestamp) TAGS(t1 int)"
)
tdSql
.
execute
(
"create table t2ts1 using stb2ts tags(1)"
)
tdSql
.
execute
(
f
"insert into t2ts1 values (
{
ts1
}
,
{
ts1
}
,
{
ts1
}
, 1,
{
ts1
}
)"
)
tdSql
.
execute
(
f
"insert into t2ts1 values (
{
ts2
}
,
{
ts2
}
,
{
ts2
}
, 2,
{
ts2
}
)"
)
tdSql
.
execute
(
f
"insert into t2ts1 values (
{
ts3
}
,
{
ts3
}
,
{
ts3
}
, 4,
{
ts3
}
)"
)
tdSql
.
execute
(
f
"insert into t2ts1 values ('
{
ts4
}
', '
{
ts4
}
', '
{
ts4
}
', 3, '
{
ts4
}
')"
)
tdLog
.
printNoPrefix
(
"==========step2:check inserted data"
)
tdSql
.
query
(
"select * from stb2ts where ts1=0 and ts2='1970-01-01 08:00:00' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
4
,
'1970-01-01 08:00:00'
)
tdSql
.
query
(
"select * from stb2ts where ts1=-28800000 and ts2='1970-01-01 00:00:00' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
4
,
'1970-01-01 00:00:00'
)
tdSql
.
query
(
"select * from stb2ts where ts1=-946800000000 and ts2='1940-01-01 00:00:00' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
4
,
'1940-01-01 00:00:00'
)
tdSql
.
query
(
"select * from stb2ts where ts1=-631180800000 and ts2='1950-01-01 00:00:00' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
4
,
'1950-01-01 00:00:00'
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tests/pytest/fulltest.sh
浏览文件 @
512551b1
...
...
@@ -239,6 +239,7 @@ python3 ./test.py -f stream/table_n.py
#alter table
python3 ./test.py
-f
alter/alter_table_crash.py
python3 ./test.py
-f
alter/alterTabAddTagWithNULL.py
python3 ./test.py
-f
alter/alterTimestampColDataProcess.py
# client
python3 ./test.py
-f
client/client.py
...
...
@@ -308,6 +309,11 @@ python3 ./test.py -f insert/unsignedSmallint.py
python3 ./test.py
-f
insert/unsignedTinyint.py
python3 ./test.py
-f
query/filterAllUnsignedIntTypes.py
python3 ./test.py
-f
tag_lite/unsignedInt.py
python3 ./test.py
-f
tag_lite/unsignedBigint.py
python3 ./test.py
-f
tag_lite/unsignedSmallint.py
python3 ./test.py
-f
tag_lite/unsignedTinyint.py
python3 ./test.py
-f
functions/function_percentile2.py
python3 ./test.py
-f
insert/boundary2.py
python3 ./test.py
-f
alter/alter_debugFlag.py
...
...
tests/pytest/query/queryFilterTswithDateUnit.py
0 → 100644
浏览文件 @
512551b1
###################################################################
# Copyright (c) 2016 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.dnodes
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to execute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
insertnow
(
self
,
tsp1
,
tsp2
,
tsp3
):
tdSql
.
execute
(
"create table stbts (ts timestamp, ts1 timestamp, c1 int, ts2 timestamp) TAGS(t1 int)"
)
tdSql
.
execute
(
"create table tts1 using stbts tags(1)"
)
tdSql
.
execute
(
"insert into tts1 values (now+1d, now+1d, 6, now+1d)"
)
tdSql
.
execute
(
"insert into tts1 values (now, now, 5, now)"
)
tdSql
.
execute
(
"insert into tts1 values (now-1d, now-1d, 4, now-1d)"
)
tdSql
.
execute
(
f
"insert into tts1 values (
{
tsp1
}
,
{
tsp1
}
, 3,
{
tsp1
}
)"
)
tdSql
.
execute
(
f
"insert into tts1 values (
{
tsp2
}
,
{
tsp2
}
, 2,
{
tsp2
}
)"
)
tdSql
.
execute
(
f
"insert into tts1 values (
{
tsp3
}
,
{
tsp3
}
, 1,
{
tsp3
}
)"
)
def
querynow
(
self
):
tdLog
.
printNoPrefix
(
"==========step query: execute query operation"
)
time
.
sleep
(
1
)
cols
=
[
"ts"
,
"ts1"
,
"ts2"
]
for
col
in
cols
:
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 0d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 0s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 0a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 0m "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 0h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 0u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 0w "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1m+1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1w-1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 0a/1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1d/0s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1s*1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 0w/0d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1m+1h "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1w-1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 0a/1u "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1d/0s "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1s*1a "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 0w/0d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
= 1u+1 "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
< 1a-1 "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
> 1s*1 "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
>= 1m/1 "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<= 1h/0 "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 0/1d "
)
tdSql
.
error
(
f
" select * from tts1 where
{
col
}
<> 1w+'2010-01-01 00:00:00' "
)
def
run
(
self
):
tdSql
.
execute
(
"drop database if exists dbms"
)
tdSql
.
execute
(
"drop database if exists dbus"
)
# timestamp list:
# 0 -> "1970-01-01 08:00:00" | -28800000 -> "1970-01-01 00:00:00" | -946800000000 -> "1940-01-01 00:00:00"
# -631180800000 -> "1950-01-01 00:00:00"
tdLog
.
printNoPrefix
(
"==========step1:create table precision ms && insert data && query"
)
# create databases precision is ms
tdSql
.
execute
(
"create database if not exists dbms keep 36500"
)
tdSql
.
execute
(
"use dbms"
)
tsp1
=
0
tsp2
=
-
28800000
tsp3
=
-
946800000000
self
.
insertnow
(
tsp1
,
tsp2
,
tsp3
)
self
.
querynow
()
tdLog
.
printNoPrefix
(
"==========step2:create table precision us && insert data && query"
)
# create databases precision is us
tdSql
.
execute
(
"create database if not exists dbus keep 36500 precision 'us' "
)
tdSql
.
execute
(
"use dbus"
)
tsp2
=
-
28800000
*
1000
tsp3
=
-
946800000000
*
1000
self
.
insertnow
(
tsp1
,
tsp2
,
tsp3
)
self
.
querynow
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tests/test-all.sh
浏览文件 @
512551b1
...
...
@@ -481,14 +481,14 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" !=
totalExamplePass
=
0
echo
"Running tests"
#
./apitest > /dev/null 2>&1
#
if [ $? != "0" ]; then
#
echo "apitest failed"
#
totalExampleFailed=`expr $totalExampleFailed + 1`
#
else
#
echo "apitest pass"
#
totalExamplePass=`expr $totalExamplePass + 1`
#
fi
./apitest
>
/dev/null 2>&1
if
[
$?
!=
"0"
]
;
then
echo
"apitest failed"
totalExampleFailed
=
`
expr
$totalExampleFailed
+ 1
`
else
echo
"apitest pass"
totalExamplePass
=
`
expr
$totalExamplePass
+ 1
`
fi
./prepare 127.0.0.1
>
/dev/null 2>&1
if
[
$?
!=
"0"
]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录