Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c4c7402f
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看板
提交
c4c7402f
编写于
5月 06, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/taosdata/TDengine
上级
52b739ab
1466505e
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
754 addition
and
333 deletion
+754
-333
.drone.yml
.drone.yml
+2
-2
cmake/version.inc
cmake/version.inc
+1
-1
snap/snapcraft.yaml
snap/snapcraft.yaml
+2
-2
src/connector/jdbc/src/main/java/com/taosdata/jdbc/rs/RestfulPreparedStatement.java
...n/java/com/taosdata/jdbc/rs/RestfulPreparedStatement.java
+0
-11
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/Utils.java
...tor/jdbc/src/main/java/com/taosdata/jdbc/utils/Utils.java
+4
-4
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java
...r/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java
+38
-47
src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/InsertSpecialCharacterJniTest.java
...om/taosdata/jdbc/cases/InsertSpecialCharacterJniTest.java
+25
-0
src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/InsertSpecialCharacterRestfulTest.java
...aosdata/jdbc/cases/InsertSpecialCharacterRestfulTest.java
+25
-0
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+341
-259
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+8
-6
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+1
-1
tests/pytest/crash_gen/valgrind_taos.supp
tests/pytest/crash_gen/valgrind_taos.supp
+165
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-0
tests/pytest/insert/insertDynamicColBeforeVal.py
tests/pytest/insert/insertDynamicColBeforeVal.py
+136
-0
tests/pytest/util/sql.py
tests/pytest/util/sql.py
+5
-0
未找到文件。
.drone.yml
浏览文件 @
c4c7402f
...
...
@@ -11,7 +11,7 @@ steps:
image
:
gcc
commands
:
-
apt-get update
-
apt-get install -y cmake build-essential
git
-
apt-get install -y cmake build-essential
-
mkdir debug
-
cd debug
-
cmake ..
...
...
@@ -82,7 +82,7 @@ platform:
steps
:
-
name
:
build
image
:
gc
c
image
:
arm32v7/ubuntu:bioni
c
commands
:
-
apt-get update
-
apt-get install -y cmake build-essential
...
...
cmake/version.inc
浏览文件 @
c4c7402f
...
...
@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF
(
DEFINED
VERNUMBER
)
SET
(
TD_VER_NUMBER
$
{
VERNUMBER
})
ELSE
()
SET
(
TD_VER_NUMBER
"2.0.20.
0
"
)
SET
(
TD_VER_NUMBER
"2.0.20.
2
"
)
ENDIF
()
IF
(
DEFINED
VERCOMPATIBLE
)
...
...
snap/snapcraft.yaml
浏览文件 @
c4c7402f
name
:
tdengine
base
:
core18
version
:
'
2.0.20.
0
'
version
:
'
2.0.20.
2
'
icon
:
snap/gui/t-dengine.svg
summary
:
an open-source big data platform designed and optimized for IoT.
description
:
|
...
...
@@ -72,7 +72,7 @@ parts:
-
usr/bin/taosd
-
usr/bin/taos
-
usr/bin/taosdemo
-
usr/lib/libtaos.so.2.0.20.
0
-
usr/lib/libtaos.so.2.0.20.
2
-
usr/lib/libtaos.so.1
-
usr/lib/libtaos.so
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/rs/RestfulPreparedStatement.java
浏览文件 @
c4c7402f
package
com.taosdata.jdbc.rs
;
import
com.google.common.collect.Range
;
import
com.google.common.collect.RangeSet
;
import
com.google.common.collect.TreeRangeSet
;
import
com.taosdata.jdbc.TSDBError
;
import
com.taosdata.jdbc.TSDBErrorNumbers
;
import
com.taosdata.jdbc.utils.SqlSyntaxValidator
;
import
com.taosdata.jdbc.utils.Utils
;
import
java.io.InputStream
;
import
java.io.Reader
;
import
java.math.BigDecimal
;
import
java.net.URL
;
import
java.nio.charset.Charset
;
import
java.sql.*
;
import
java.util.Calendar
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
public
class
RestfulPreparedStatement
extends
RestfulStatement
implements
PreparedStatement
{
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/Utils.java
浏览文件 @
c4c7402f
...
...
@@ -67,7 +67,7 @@ public class Utils {
findPlaceholderPosition
(
preparedSql
,
placeholderPositions
);
findClauseRangeSet
(
preparedSql
,
clause
,
clauseRangeSet
);
return
transformSql
(
prepared
Sql
,
parameters
,
placeholderPositions
,
clauseRangeSet
);
return
transformSql
(
raw
Sql
,
parameters
,
placeholderPositions
,
clauseRangeSet
);
}
private
static
void
findClauseRangeSet
(
String
preparedSql
,
String
[]
regexArr
,
RangeSet
<
Integer
>
clauseRangeSet
)
{
...
...
@@ -95,14 +95,14 @@ public class Utils {
/***
*
* @param
prepared
Sql
* @param
raw
Sql
* @param paramArr
* @param placeholderPosition
* @param clauseRangeSet
* @return
*/
private
static
String
transformSql
(
String
prepared
Sql
,
Object
[]
paramArr
,
Map
<
Integer
,
Integer
>
placeholderPosition
,
RangeSet
<
Integer
>
clauseRangeSet
)
{
String
[]
sqlArr
=
prepared
Sql
.
split
(
"\\?"
);
private
static
String
transformSql
(
String
raw
Sql
,
Object
[]
paramArr
,
Map
<
Integer
,
Integer
>
placeholderPosition
,
RangeSet
<
Integer
>
clauseRangeSet
)
{
String
[]
sqlArr
=
raw
Sql
.
split
(
"\\?"
);
return
IntStream
.
range
(
0
,
sqlArr
.
length
).
mapToObj
(
index
->
{
if
(
index
==
paramArr
.
length
)
return
sqlArr
[
index
];
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java
浏览文件 @
c4c7402f
...
...
@@ -12,6 +12,7 @@ import java.util.Properties;
import
java.util.concurrent.TimeUnit
;
public
class
SubscribeTest
{
Connection
connection
;
Statement
statement
;
String
dbName
=
"test"
;
...
...
@@ -19,62 +20,53 @@ public class SubscribeTest {
String
host
=
"127.0.0.1"
;
String
topic
=
"test"
;
@Before
public
void
createDatabase
()
{
try
{
Class
.
forName
(
"com.taosdata.jdbc.TSDBDriver"
);
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_CHARSET
,
"UTF-8"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_LOCALE
,
"en_US.UTF-8"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_TIME_ZONE
,
"UTC-8"
);
connection
=
DriverManager
.
getConnection
(
"jdbc:TAOS://"
+
host
+
":0/"
,
properties
);
statement
=
connection
.
createStatement
();
statement
.
execute
(
"drop database if exists "
+
dbName
);
statement
.
execute
(
"create database if not exists "
+
dbName
);
statement
.
execute
(
"create table if not exists "
+
dbName
+
"."
+
tName
+
" (ts timestamp, k int, v int)"
);
long
ts
=
System
.
currentTimeMillis
();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
ts
+=
i
;
String
sql
=
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
ts
+
", "
+
(
100
+
i
)
+
", "
+
i
+
")"
;
statement
.
executeUpdate
(
sql
);
}
}
catch
(
ClassNotFoundException
|
SQLException
e
)
{
return
;
}
}
@Test
public
void
subscribe
()
{
try
{
String
rawSql
=
"select * from "
+
dbName
+
"."
+
tName
+
";"
;
System
.
out
.
println
(
rawSql
);
// TSDBSubscribe subscribe = ((TSDBConnection) connection).subscribe(topic, rawSql, false);
TSDBConnection
conn
=
connection
.
unwrap
(
TSDBConnection
.
class
);
TSDBSubscribe
subscribe
=
conn
.
subscribe
(
topic
,
rawSql
,
false
);
int
a
=
0
;
while
(
true
)
{
TimeUnit
.
MILLISECONDS
.
sleep
(
1000
);
TSDBResultSet
resSet
=
subscribe
.
consume
();
while
(
resSet
.
next
())
{
for
(
int
i
=
1
;
i
<=
resSet
.
getMetaData
().
getColumnCount
();
i
++)
{
System
.
out
.
printf
(
i
+
": "
+
resSet
.
getString
(
i
)
+
"\t"
);
}
System
.
out
.
println
(
"\n======"
+
a
+
"=========="
);
}
a
++;
if
(
a
>=
2
)
{
break
;
}
resSet
.
close
();
}
// int a = 0;
// while (true) {
// TimeUnit.MILLISECONDS.sleep(1000);
// TSDBResultSet resSet = subscribe.consume();
// while (resSet.next()) {
// for (int i = 1; i <= resSet.getMetaData().getColumnCount(); i++) {
// System.out.printf(i + ": " + resSet.getString(i) + "\t");
// }
// System.out.println("\n======" + a + "==========");
// }
// a++;
// if (a >= 2) {
// break;
// }
// resSet.close();
// }
//
// subscribe.close(true);
subscribe
.
close
(
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Before
public
void
createDatabase
()
throws
SQLException
{
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_CHARSET
,
"UTF-8"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_LOCALE
,
"en_US.UTF-8"
);
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_TIME_ZONE
,
"UTC-8"
);
connection
=
DriverManager
.
getConnection
(
"jdbc:TAOS://"
+
host
+
":0/"
,
properties
);
statement
=
connection
.
createStatement
();
statement
.
execute
(
"drop database if exists "
+
dbName
);
statement
.
execute
(
"create database if not exists "
+
dbName
);
statement
.
execute
(
"create table if not exists "
+
dbName
+
"."
+
tName
+
" (ts timestamp, k int, v int)"
);
long
ts
=
System
.
currentTimeMillis
();
statement
.
executeUpdate
(
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
ts
+
", 100, 1)"
);
statement
.
executeUpdate
(
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
(
ts
+
1
)
+
", 101, 2)"
);
}
@After
public
void
close
()
{
try
{
...
...
@@ -86,6 +78,5 @@ public class SubscribeTest {
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/InsertSpecialCharacterJniTest.java
浏览文件 @
c4c7402f
...
...
@@ -345,6 +345,31 @@ public class InsertSpecialCharacterJniTest {
}
}
@Test
public
void
testCase12
()
throws
SQLException
{
final
long
now
=
System
.
currentTimeMillis
();
// insert
final
String
sql
=
"insert into "
+
tbname1
+
"(ts, f1, f2) values(?, 'HelloTDengine', ?) ; "
;
try
(
PreparedStatement
pstmt
=
conn
.
prepareStatement
(
sql
))
{
pstmt
.
setTimestamp
(
1
,
new
Timestamp
(
now
));
pstmt
.
setString
(
2
,
special_character_str_4
);
int
ret
=
pstmt
.
executeUpdate
();
Assert
.
assertEquals
(
1
,
ret
);
}
// query
final
String
query
=
"select * from "
+
tbname1
;
try
(
Statement
stmt
=
conn
.
createStatement
())
{
ResultSet
rs
=
stmt
.
executeQuery
(
query
);
rs
.
next
();
long
timestamp
=
rs
.
getTimestamp
(
1
).
getTime
();
Assert
.
assertEquals
(
now
,
timestamp
);
String
f1
=
new
String
(
rs
.
getBytes
(
2
));
Assert
.
assertEquals
(
"HelloTDengine"
,
f1
);
String
f2
=
rs
.
getString
(
3
);
Assert
.
assertEquals
(
special_character_str_4
,
f2
);
}
}
@Before
public
void
before
()
throws
SQLException
{
try
(
Statement
stmt
=
conn
.
createStatement
())
{
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/InsertSpecialCharacterRestfulTest.java
浏览文件 @
c4c7402f
...
...
@@ -346,6 +346,31 @@ public class InsertSpecialCharacterRestfulTest {
}
}
@Test
public
void
testCase12
()
throws
SQLException
{
final
long
now
=
System
.
currentTimeMillis
();
// insert
final
String
sql
=
"insert into "
+
tbname1
+
"(ts, f1, f2) values(?, 'HelloTDengine', ?) ; "
;
try
(
PreparedStatement
pstmt
=
conn
.
prepareStatement
(
sql
))
{
pstmt
.
setTimestamp
(
1
,
new
Timestamp
(
now
));
pstmt
.
setString
(
2
,
special_character_str_4
);
int
ret
=
pstmt
.
executeUpdate
();
Assert
.
assertEquals
(
1
,
ret
);
}
// query
final
String
query
=
"select * from "
+
tbname1
;
try
(
Statement
stmt
=
conn
.
createStatement
())
{
ResultSet
rs
=
stmt
.
executeQuery
(
query
);
rs
.
next
();
long
timestamp
=
rs
.
getTimestamp
(
1
).
getTime
();
Assert
.
assertEquals
(
now
,
timestamp
);
String
f1
=
new
String
(
rs
.
getBytes
(
2
));
Assert
.
assertEquals
(
"HelloTDengine"
,
f1
);
String
f2
=
rs
.
getString
(
3
);
Assert
.
assertEquals
(
special_character_str_4
,
f2
);
}
}
@Before
public
void
before
()
throws
SQLException
{
try
(
Statement
stmt
=
conn
.
createStatement
())
{
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
c4c7402f
此差异已折叠。
点击以展开。
src/kit/taosdump/taosdump.c
浏览文件 @
c4c7402f
...
...
@@ -99,11 +99,13 @@ enum _describe_table_index {
TSDB_MAX_DESCRIBE_METRIC
};
#define COL_NOTE_LEN 128
typedef
struct
{
char
field
[
TSDB_COL_NAME_LEN
+
1
];
char
type
[
16
];
int
length
;
char
note
[
128
];
char
note
[
COL_NOTE_LEN
];
}
SColDes
;
typedef
struct
{
...
...
@@ -523,7 +525,7 @@ int main(int argc, char *argv[]) {
/* Parse our arguments; every option seen by parse_opt will be
reflected in arguments. */
if
(
argc
>
1
)
if
(
argc
>
2
)
parse_args
(
argc
,
argv
,
&
g_args
);
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
0
,
&
g_args
);
...
...
@@ -1188,16 +1190,16 @@ int taosGetTableDes(char* dbName, char *table, STableDef *tableDes, TAOS* taosCo
case
TSDB_DATA_TYPE_BINARY
:
{
memset
(
tableDes
->
cols
[
i
].
note
,
0
,
sizeof
(
tableDes
->
cols
[
i
].
note
));
tableDes
->
cols
[
i
].
note
[
0
]
=
'\''
;
char
tbuf
[
CO
MMAND_SIZE
];
converStringToReadable
((
char
*
)
row
[
0
],
length
[
0
],
tbuf
,
CO
MMAND_SIZE
);
char
tbuf
[
CO
L_NOTE_LEN
];
converStringToReadable
((
char
*
)
row
[
0
],
length
[
0
],
tbuf
,
CO
L_NOTE_LEN
);
char
*
pstr
=
stpcpy
(
&
(
tableDes
->
cols
[
i
].
note
[
1
]),
tbuf
);
*
(
pstr
++
)
=
'\''
;
break
;
}
case
TSDB_DATA_TYPE_NCHAR
:
{
memset
(
tableDes
->
cols
[
i
].
note
,
0
,
sizeof
(
tableDes
->
cols
[
i
].
note
));
char
tbuf
[
CO
MMAND_SIZE
];
convertNCharToReadable
((
char
*
)
row
[
0
],
length
[
0
],
tbuf
,
CO
MMAND_SIZE
);
char
tbuf
[
CO
L_NOTE_LEN
-
2
];
// need reserve 2 bytes for ' '
convertNCharToReadable
((
char
*
)
row
[
0
],
length
[
0
],
tbuf
,
CO
L_NOTE_LEN
);
sprintf
(
tableDes
->
cols
[
i
].
note
,
"
\'
%s
\'
"
,
tbuf
);
break
;
}
...
...
src/rpc/src/rpcMain.c
浏览文件 @
c4c7402f
...
...
@@ -295,7 +295,7 @@ void *rpcOpen(const SRpcInit *pInit) {
return
NULL
;
}
}
else
{
pRpc
->
pCache
=
rpcOpenConnCache
(
pRpc
->
sessions
,
rpcCloseConn
,
pRpc
->
tmrCtrl
,
pRpc
->
idleTime
*
3
0
);
pRpc
->
pCache
=
rpcOpenConnCache
(
pRpc
->
sessions
,
rpcCloseConn
,
pRpc
->
tmrCtrl
,
pRpc
->
idleTime
*
2
0
);
if
(
pRpc
->
pCache
==
NULL
)
{
tError
(
"%s failed to init connection cache"
,
pRpc
->
label
);
rpcClose
(
pRpc
);
...
...
tests/pytest/crash_gen/valgrind_taos.supp
浏览文件 @
c4c7402f
...
...
@@ -17332,3 +17332,168 @@
fun:PyVectorcall_Call
fun:_PyEval_EvalFrameDefault
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:lib_build_and_cache_attr
fun:lib_getattr
fun:_PyEval_EvalFrameDefault
fun:_PyFunction_Vectorcall
fun:_PyEval_EvalFrameDefault
fun:_PyEval_EvalCodeWithName
fun:PyEval_EvalCode
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyVectorcall_Call
fun:_PyEval_EvalFrameDefault
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:lib_build_and_cache_attr
fun:lib_getattr
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
fun:_PyFunction_Vectorcall
fun:_PyEval_EvalFrameDefault
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
fun:PyEval_EvalCode
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
fun:_PyEval_EvalCodeWithName
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_my_Py_InitModule
fun:lib_getattr
fun:b_init_cffi_1_0_external_module
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyObject_CallMethod
fun:_cffi_init
fun:PyInit__bcrypt
fun:_PyImport_LoadDynamicModuleWithSpec
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyVectorcall_Call
fun:_PyEval_EvalFrameDefault
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_PyObject_GC_New
fun:lib_getattr
fun:ffi_internal_new
fun:b_init_cffi_1_0_external_module
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyObject_CallMethod
fun:_cffi_init
fun:PyInit__bcrypt
fun:_PyImport_LoadDynamicModuleWithSpec
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyVectorcall_Call
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:lib_build_cpython_func.isra.87
fun:lib_build_and_cache_attr
fun:lib_getattr
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
fun:_PyFunction_Vectorcall
fun:_PyEval_EvalFrameDefault
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:lib_build_and_cache_attr
fun:lib_getattr
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
fun:_PyFunction_Vectorcall
fun:_PyEval_EvalFrameDefault
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
obj:/usr/bin/python3.8
fun:_PyEval_EvalFrameDefault
fun:_PyEval_EvalCodeWithName
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_my_Py_InitModule
fun:b_init_cffi_1_0_external_module
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyObject_CallMethod
fun:_cffi_init
fun:PyInit__bcrypt
fun:_PyImport_LoadDynamicModuleWithSpec
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyVectorcall_Call
fun:_PyEval_EvalFrameDefault
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_my_Py_InitModule
fun:b_init_cffi_1_0_external_module
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyObject_CallMethod
fun:PyInit__openssl
fun:_PyImport_LoadDynamicModuleWithSpec
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyVectorcall_Call
fun:_PyEval_EvalFrameDefault
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_PyObject_GC_New
fun:ffi_internal_new
fun:b_init_cffi_1_0_external_module
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyObject_CallMethod
fun:_cffi_init
fun:PyInit__bcrypt
fun:_PyImport_LoadDynamicModuleWithSpec
obj:/usr/bin/python3.8
obj:/usr/bin/python3.8
fun:PyVectorcall_Call
}
\ No newline at end of file
tests/pytest/fulltest.sh
浏览文件 @
c4c7402f
...
...
@@ -23,6 +23,7 @@ python3 ./test.py -f insert/insertIntoTwoTables.py
python3 ./test.py
-f
insert/before_1970.py
python3 bug2265.py
python3 ./test.py
-f
insert/bug3654.py
python3 ./test.py
-f
insert/insertDynamicColBeforeVal.py
#table
python3 ./test.py
-f
table/alter_wal0.py
...
...
tests/pytest/insert/insertDynamicColBeforeVal.py
0 → 100644
浏览文件 @
c4c7402f
###################################################################
# 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
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db keep 3650"
)
tdSql
.
execute
(
"use db"
)
tdLog
.
printNoPrefix
(
"==========step1:create table"
)
tdSql
.
execute
(
"create table stb1 (ts timestamp, c11 int, c12 float ) TAGS(t11 int, t12 int )"
)
tdLog
.
printNoPrefix
(
"==========step2:insert data with new syntax"
)
tdSql
.
execute
(
"insert into t1 using stb1(t11, t12) tags(11, 12) (ts, c11, c12) values (now, 10, 20)"
)
# case for tag-value
tdSql
.
execute
(
"insert into t2 using stb1(t11) tags(21) (ts, c11, c12) values (now-1m, 11, 21)"
)
tdSql
.
execute
(
"insert into t3 using stb1 tags(31, 32) (ts, c11, c12) values (now-2m, 12, 22)"
)
tdSql
.
error
(
"insert into t4 using stb1(t11, t12) (ts, c11, c12) values (now-3m, 13, 23)"
)
tdSql
.
error
(
"insert into t5 using stb1(t11, t12) tags() (ts, c11, c12) values (now-4m, 14, 24)"
)
tdSql
.
error
(
"insert into t6 using stb1(t11, t12) tags(41) (ts, c11, c12) values (now-5m, 15, 25)"
)
tdSql
.
error
(
"insert into t7 using stb1(t12) tags(51, 52) (ts, c11, c12) values (now-6m, 16, 26)"
)
tdSql
.
execute
(
"insert into t8 using stb1(t11, t12) tags('61', 62) (ts, c11, c12) values (now-7m, 17, 27)"
)
# case for col-value
tdSql
.
execute
(
"insert into t9 using stb1(t11, t12) tags(71, 72) values (now-8m, 18, 28)"
)
tdSql
.
error
(
"insert into t10 using stb1(t11, t12) tags(81, 82) (ts, c11, c12) values ()"
)
tdSql
.
error
(
"insert into t11 using stb1(t11, t12) tags(91, 92) (ts, c11, c12) "
)
tdSql
.
error
(
"insert into t12 using stb1(t11, t12) tags(101, 102) values (now-9m, 19)"
)
tdSql
.
error
(
"insert into t13 using stb1(t11, t12) tags(111, 112) (ts, c11) values (now-10m, 110, 210)"
)
tdSql
.
error
(
"insert into t14 using stb1(t11, t12) tags(121, 122) (ts, c11, c12) values (now-11m, 111)"
)
tdSql
.
execute
(
"insert into t15 using stb1(t11, t12) tags(131, 132) (ts, c11, c12) values (now-12m, NULL , 212)"
)
tdSql
.
execute
(
"insert into t16 using stb1(t11, t12) tags(141, 142) (ts, c11, c12) values (now-13m, 'NULL', 213)"
)
tdSql
.
error
(
"insert into t17 using stb1(t11, t12) tags(151, 152) (ts, c11, c12) values (now-14m, Nan, 214)"
)
tdSql
.
error
(
"insert into t18 using stb1(t11, t12) tags(161, 162) (ts, c11, c12) values (now-15m, 'NaN', 215)"
)
tdSql
.
execute
(
"insert into t19 using stb1(t11, t12) tags(171, 172) (ts, c11) values (now-16m, 216)"
)
tdSql
.
error
(
"insert into t20 using stb1(t11, t12) tags(181, 182) (c11, c12) values (117, 217)"
)
# multi-col_value
tdSql
.
execute
(
"insert into t21 using stb1(t11, t12) tags(191, 192) (ts, c11, c12) values (now-17m, 118, 218)(now-18m, 119, 219)"
)
tdSql
.
execute
(
"insert into t22 using stb1(t11, t12) tags(201, 202) values (now-19m, 120, 220)(now-19m, 121, 221)"
)
tdSql
.
error
(
"insert into t23 using stb1(t11, t12) tags(211, 212) values (now-20m, 122, 222) (ts, c11, c12) values (now-21m, 123, 223)"
)
tdSql
.
error
(
"insert into t24 using stb1(t11, t12) tags(221, 222) (ts, c11, c12) values (now-22m, 124, 224) (ts, c11, c12) values (now-23m, 125, 225)"
)
tdSql
.
execute
(
"insert into t25 (ts, c11, c12) using stb1(t11, t12) tags(231, 232) values (now-24m, 126, 226)(now-25m, 127, 227)"
)
tdSql
.
error
(
"insert into t26 (ts, c11, c12) values (now-24m, 128, 228)(now-25m, 129, 229) using stb1(t11, t12) tags(241, 242) "
)
tdSql
.
error
(
"insert into t27 (ts, c11, c12) values (now-24m, 130, 230) using stb1(t11, t12) tags(251, 252) "
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
21
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tests/pytest/util/sql.py
浏览文件 @
c4c7402f
...
...
@@ -136,6 +136,11 @@ class TDSql:
def
checkData
(
self
,
row
,
col
,
data
):
self
.
checkRowCol
(
row
,
col
)
if
self
.
queryResult
[
row
][
col
]
!=
data
:
if
self
.
cursor
.
istype
(
col
,
"TIMESTAMP"
)
and
self
.
queryResult
[
row
][
col
]
==
datetime
.
datetime
.
fromisoformat
(
data
):
tdLog
.
info
(
"sql:%s, row:%d col:%d data:%s == expect:%s"
%
(
self
.
sql
,
row
,
col
,
self
.
queryResult
[
row
][
col
],
data
))
return
if
str
(
self
.
queryResult
[
row
][
col
])
==
str
(
data
):
tdLog
.
info
(
"sql:%s, row:%d col:%d data:%s == expect:%s"
%
(
self
.
sql
,
row
,
col
,
self
.
queryResult
[
row
][
col
],
data
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录