Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2d62f182
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看板
提交
2d62f182
编写于
9月 18, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/query
上级
079cd0e0
77048d5a
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
586 addition
and
483 deletion
+586
-483
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+2
-2
src/connector/jdbc/pom.xml
src/connector/jdbc/pom.xml
+98
-97
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java
.../jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java
+0
-54
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java
...src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java
+3
-3
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java
...ctor/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java
+356
-306
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java
...r/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java
+1
-1
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+14
-12
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/plugins/http/src/httpContext.c
src/plugins/http/src/httpContext.c
+1
-0
src/query/inc/qFill.h
src/query/inc/qFill.h
+2
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-1
src/query/src/qFill.c
src/query/src/qFill.c
+6
-2
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+2
-2
tests/pytest/client/twoClients.py
tests/pytest/client/twoClients.py
+96
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-0
tests/script/general/http/chunked.sim
tests/script/general/http/chunked.sim
+1
-1
未找到文件。
src/client/src/tscLocalMerge.c
浏览文件 @
2d62f182
...
...
@@ -373,8 +373,8 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
if
(
pQueryInfo
->
fillType
!=
TSDB_FILL_NONE
)
{
SFillColInfo
*
pFillCol
=
createFillColInfo
(
pQueryInfo
);
pReducer
->
pFillInfo
=
taosInitFillInfo
(
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
4096
,
(
int32_t
)
numOfCols
,
&
pQueryInfo
->
interval
,
tinfo
.
precision
,
pQueryInfo
->
fillType
,
pFillCol
);
4096
,
(
int32_t
)
numOfCols
,
pQueryInfo
->
interval
.
sliding
,
pQueryInfo
->
interval
.
slidingUnit
,
tinfo
.
precision
,
pQueryInfo
->
fillType
,
pFillCol
);
}
}
...
...
src/connector/jdbc/pom.xml
浏览文件 @
2d62f182
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
2.0.0
</version>
<packaging>
jar
</packaging>
<name>
JDBCDriver
</name>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<description>
TDengine JDBC Driver
</description>
<licenses>
<license>
<name>
GNU AFFERO GENERAL PUBLIC LICENSE Version 3
</name>
<url>
https://github.com/taosdata/TDengine/blob/master/LICENSE
</url>
<distribution>
repo
</distribution>
</license>
</licenses>
<scm>
<connection>
scm:git:git://github.com/taosdata/TDengine.git
</connection>
<developerConnection>
scm:git:git@github.com:taosdata/TDengine.git
</developerConnection>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
2.0.0
</version>
<packaging>
jar
</packaging>
<name>
JDBCDriver
</name>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<tag>
HEAD
</tag>
</scm>
<developers>
<developer>
<name>
taosdata
</name>
<email>
support@taosdata.com
</email>
<organization>
https://www.taosdata.com/
</organization>
<organizationUrl>
https://www.taosdata.com/
</organizationUrl>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<maven-compiler-plugin.version>
3.6.0
</maven-compiler-plugin.version>
<commons-logging.version>
1.1.2
</commons-logging.version>
<commons-lang3.version>
3.5
</commons-lang3.version>
</properties>
<dependencies>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<version>
${commons-logging.version}
</version>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.13
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.0.0
</version>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly-jar.xml
</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
${maven-compiler-plugin.version}
</version>
<configuration>
<encoding>
UTF-8
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<debug>
true
</debug>
<showDeprecation>
true
</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.12.4
</version>
<configuration>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
<description>
TDengine JDBC Driver
</description>
<licenses>
<license>
<name>
GNU AFFERO GENERAL PUBLIC LICENSE Version 3
</name>
<url>
https://github.com/taosdata/TDengine/blob/master/LICENSE
</url>
<distribution>
repo
</distribution>
</license>
</licenses>
<scm>
<connection>
scm:git:git://github.com/taosdata/TDengine.git
</connection>
<developerConnection>
scm:git:git@github.com:taosdata/TDengine.git
</developerConnection>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<tag>
HEAD
</tag>
</scm>
<developers>
<developer>
<name>
taosdata
</name>
<email>
support@taosdata.com
</email>
<organization>
https://www.taosdata.com/
</organization>
<organizationUrl>
https://www.taosdata.com/
</organizationUrl>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<maven-compiler-plugin.version>
3.6.0
</maven-compiler-plugin.version>
<commons-logging.version>
1.1.2
</commons-logging.version>
<commons-lang3.version>
3.5
</commons-lang3.version>
</properties>
<dependencies>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<version>
${commons-logging.version}
</version>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.13
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.0.0
</version>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly-jar.xml
</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
${maven-compiler-plugin.version}
</version>
<configuration>
<encoding>
UTF-8
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<debug>
true
</debug>
<showDeprecation>
true
</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.12.4
</version>
<configuration>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java
浏览文件 @
2d62f182
...
...
@@ -53,66 +53,12 @@ public class TSDBConnection implements Connection {
public
TSDBConnection
(
Properties
info
,
TSDBDatabaseMetaData
meta
)
throws
SQLException
{
this
.
dbMetaData
=
meta
;
//load taos.cfg start
File
cfgDir
=
loadConfigDir
(
info
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_CONFIG_DIR
));
File
cfgFile
=
cfgDir
.
listFiles
((
dir
,
name
)
->
"taos.cfg"
.
equalsIgnoreCase
(
name
))[
0
];
List
<
String
>
endpoints
=
loadConfigEndpoints
(
cfgFile
);
if
(!
endpoints
.
isEmpty
())
{
info
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_HOST
,
endpoints
.
get
(
0
).
split
(
":"
)[
0
]);
info
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_PORT
,
endpoints
.
get
(
0
).
split
(
":"
)[
1
]);
}
//load taos.cfg end
connect
(
info
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_HOST
),
Integer
.
parseInt
(
info
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_PORT
,
"0"
)),
info
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_DBNAME
),
info
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_USER
),
info
.
getProperty
(
TSDBDriver
.
PROPERTY_KEY_PASSWORD
));
}
private
List
<
String
>
loadConfigEndpoints
(
File
cfgFile
)
{
List
<
String
>
endpoints
=
new
ArrayList
<>();
try
(
BufferedReader
reader
=
new
BufferedReader
(
new
FileReader
(
cfgFile
)))
{
String
line
=
null
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
if
(
line
.
trim
().
startsWith
(
"firstEp"
)
||
line
.
trim
().
startsWith
(
"secondEp"
))
{
endpoints
.
add
(
line
.
substring
(
line
.
indexOf
(
'p'
)
+
1
).
trim
());
}
if
(
endpoints
.
size
()
>
1
)
break
;
}
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
endpoints
;
}
/**
* @param cfgDirPath
* @return return the config dir
**/
private
File
loadConfigDir
(
String
cfgDirPath
)
{
if
(
cfgDirPath
==
null
)
return
loadDefaultConfigDir
();
File
cfgDir
=
new
File
(
cfgDirPath
);
if
(!
cfgDir
.
exists
())
return
loadDefaultConfigDir
();
return
cfgDir
;
}
/**
* @return search the default config dir, if the config dir is not exist will return null
*/
private
File
loadDefaultConfigDir
()
{
File
cfgDir
;
File
cfgDir_linux
=
new
File
(
"/etc/taos"
);
cfgDir
=
cfgDir_linux
.
exists
()
?
cfgDir_linux
:
null
;
File
cfgDir_windows
=
new
File
(
"C:\\TDengine\\cfg"
);
cfgDir
=
(
cfgDir
==
null
&&
cfgDir_windows
.
exists
())
?
cfgDir_windows
:
cfgDir
;
return
cfgDir
;
}
private
void
connect
(
String
host
,
int
port
,
String
dbName
,
String
user
,
String
password
)
throws
SQLException
{
this
.
connector
=
new
TSDBJNIConnector
();
this
.
connector
.
connect
(
host
,
port
,
dbName
,
user
,
password
);
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java
浏览文件 @
2d62f182
...
...
@@ -68,15 +68,15 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData {
}
public
boolean
nullsAreSortedLow
()
throws
SQLException
{
return
false
;
return
!
nullsAreSortedHigh
()
;
}
public
boolean
nullsAreSortedAtStart
()
throws
SQLException
{
return
fals
e
;
return
tru
e
;
}
public
boolean
nullsAreSortedAtEnd
()
throws
SQLException
{
return
false
;
return
!
nullsAreSortedAtStart
()
;
}
public
String
getDatabaseProductName
()
throws
SQLException
{
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java
浏览文件 @
2d62f182
此差异已折叠。
点击以展开。
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java
浏览文件 @
2d62f182
...
...
@@ -242,7 +242,7 @@ public class TSDBStatement implements Statement {
public
void
addBatch
(
String
sql
)
throws
SQLException
{
if
(
batchedArgs
==
null
)
{
batchedArgs
=
new
ArrayList
<
String
>();
batchedArgs
=
new
ArrayList
<>();
}
batchedArgs
.
add
(
sql
);
}
...
...
src/cq/src/cqMain.c
浏览文件 @
2d62f182
...
...
@@ -30,10 +30,12 @@
#include "tlog.h"
#include "twal.h"
#define cError(...) { if (cqDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR CQ ", cqDebugFlag, __VA_ARGS__); }}
#define cWarn(...) { if (cqDebugFlag & DEBUG_WARN) { taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__); }}
#define cFatal(...) { if (cqDebugFlag & DEBUG_FATAL) { taosPrintLog("CQ FATAL ", 255, __VA_ARGS__); }}
#define cError(...) { if (cqDebugFlag & DEBUG_ERROR) { taosPrintLog("CQ ERROR ", 255, __VA_ARGS__); }}
#define cWarn(...) { if (cqDebugFlag & DEBUG_WARN) { taosPrintLog("CQ WARN ", 255, __VA_ARGS__); }}
#define cInfo(...) { if (cqDebugFlag & DEBUG_INFO) { taosPrintLog("CQ ", 255, __VA_ARGS__); }}
#define cDebug(...) { if (cqDebugFlag & DEBUG_DEBUG) { taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__); }}
#define cTrace(...) { if (cqDebugFlag & DEBUG_TRACE) { taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__); }}
#define cPrint(...) { taosPrintLog("CQ ", 255, __VA_ARGS__); }
typedef
struct
{
int
vgId
;
...
...
@@ -94,7 +96,7 @@ void *cqOpen(void *ahandle, const SCqCfg *pCfg) {
pthread_mutex_init
(
&
pContext
->
mutex
,
NULL
);
c
Trace
(
"vgId:%d, CQ is opened"
,
pContext
->
vgId
);
c
Info
(
"vgId:%d, CQ is opened"
,
pContext
->
vgId
);
return
pContext
;
}
...
...
@@ -125,7 +127,7 @@ void cqClose(void *handle) {
taosTmrCleanUp
(
pContext
->
tmrCtrl
);
pContext
->
tmrCtrl
=
NULL
;
c
Trace
(
"vgId:%d, CQ is closed"
,
pContext
->
vgId
);
c
Info
(
"vgId:%d, CQ is closed"
,
pContext
->
vgId
);
free
(
pContext
);
}
...
...
@@ -133,7 +135,7 @@ void cqStart(void *handle) {
SCqContext
*
pContext
=
handle
;
if
(
pContext
->
dbConn
||
pContext
->
master
)
return
;
c
Trace
(
"vgId:%d, start all CQs"
,
pContext
->
vgId
);
c
Info
(
"vgId:%d, start all CQs"
,
pContext
->
vgId
);
pthread_mutex_lock
(
&
pContext
->
mutex
);
pContext
->
master
=
1
;
...
...
@@ -149,7 +151,7 @@ void cqStart(void *handle) {
void
cqStop
(
void
*
handle
)
{
SCqContext
*
pContext
=
handle
;
c
Trace
(
"vgId:%d, stop all CQs"
,
pContext
->
vgId
);
c
Info
(
"vgId:%d, stop all CQs"
,
pContext
->
vgId
);
if
(
pContext
->
dbConn
==
NULL
||
pContext
->
master
==
0
)
return
;
pthread_mutex_lock
(
&
pContext
->
mutex
);
...
...
@@ -160,7 +162,7 @@ void cqStop(void *handle) {
if
(
pObj
->
pStream
)
{
taos_close_stream
(
pObj
->
pStream
);
pObj
->
pStream
=
NULL
;
c
Trace
(
"vgId:%d, id:%d CQ:%s is closed"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
c
Info
(
"vgId:%d, id:%d CQ:%s is closed"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
}
else
{
taosTmrStop
(
pObj
->
tmrId
);
pObj
->
tmrId
=
0
;
...
...
@@ -188,7 +190,7 @@ void *cqCreate(void *handle, uint64_t uid, int tid, char *sqlStr, STSchema *pSch
pObj
->
pSchema
=
tdDupSchema
(
pSchema
);
pObj
->
rowSize
=
schemaTLen
(
pSchema
);
c
Trace
(
"vgId:%d, id:%d CQ:%s is created"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
c
Info
(
"vgId:%d, id:%d CQ:%s is created"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
pthread_mutex_lock
(
&
pContext
->
mutex
);
...
...
@@ -228,7 +230,7 @@ void cqDrop(void *handle) {
pObj
->
tmrId
=
0
;
}
c
Trace
(
"vgId:%d, id:%d CQ:%s is dropped"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
c
Info
(
"vgId:%d, id:%d CQ:%s is dropped"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
tdFreeSchema
(
pObj
->
pSchema
);
free
(
pObj
->
sqlStr
);
free
(
pObj
);
...
...
@@ -262,7 +264,7 @@ static void cqCreateStream(SCqContext *pContext, SCqObj *pObj) {
pObj
->
pStream
=
taos_open_stream
(
pContext
->
dbConn
,
pObj
->
sqlStr
,
cqProcessStreamRes
,
0
,
pObj
,
NULL
);
if
(
pObj
->
pStream
)
{
pContext
->
num
++
;
c
Trace
(
"vgId:%d, id:%d CQ:%s is openned"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
c
Info
(
"vgId:%d, id:%d CQ:%s is openned"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
}
else
{
cError
(
"vgId:%d, id:%d CQ:%s, failed to open"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
}
...
...
@@ -278,7 +280,7 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
STSchema
*
pSchema
=
pObj
->
pSchema
;
if
(
pObj
->
pStream
==
NULL
)
return
;
c
Trace
(
"vgId:%d, id:%d CQ:%s stream result is ready"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
c
Debug
(
"vgId:%d, id:%d CQ:%s stream result is ready"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
int
size
=
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
TD_DATA_ROW_HEAD_SIZE
+
pObj
->
rowSize
;
char
*
buffer
=
calloc
(
size
,
1
);
...
...
src/inc/taosdef.h
浏览文件 @
2d62f182
...
...
@@ -245,7 +245,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
#define TSDB_MAX_SAVED_SQL_LEN TSDB_MAX_COLUMNS * 64
#define TSDB_MAX_SQL_LEN TSDB_PAYLOAD_SIZE
#define TSDB_MAX_SQL_SHOW_LEN 256
#define TSDB_MAX_ALLOWED_SQL_LEN (
8
*1024*1024U) // sql length should be less than 8mb
#define TSDB_MAX_ALLOWED_SQL_LEN (
1
*1024*1024U) // sql length should be less than 8mb
#define TSDB_MAX_BYTES_PER_ROW 16384
#define TSDB_MAX_TAGS_LEN 16384
...
...
src/plugins/http/src/httpContext.c
浏览文件 @
2d62f182
...
...
@@ -230,4 +230,5 @@ void httpCloseContextByServer(HttpContext *pContext) {
pContext
->
parsed
=
false
;
httpRemoveContextFromEpoll
(
pContext
);
httpReleaseContext
(
pContext
,
true
);
}
src/query/inc/qFill.h
浏览文件 @
2d62f182
...
...
@@ -66,7 +66,8 @@ typedef struct SPoint {
}
SPoint
;
SFillInfo
*
taosInitFillInfo
(
int32_t
order
,
TSKEY
skey
,
int32_t
numOfTags
,
int32_t
capacity
,
int32_t
numOfCols
,
SInterval
*
pInterval
,
int8_t
precision
,
int32_t
fillType
,
SFillColInfo
*
pFillCol
);
int64_t
slidingTime
,
int8_t
slidingUnit
,
int8_t
precision
,
int32_t
fillType
,
SFillColInfo
*
pFillCol
);
void
taosResetFillInfo
(
SFillInfo
*
pFillInfo
,
TSKEY
startTimestamp
);
...
...
src/query/src/qExecutor.c
浏览文件 @
2d62f182
...
...
@@ -4581,7 +4581,8 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, void *tsdb, int32_t vgId, bo
getAlignQueryTimeWindow
(
pQuery
,
pQuery
->
window
.
skey
,
sk
,
ek
,
&
w
);
pRuntimeEnv
->
pFillInfo
=
taosInitFillInfo
(
pQuery
->
order
.
order
,
w
.
skey
,
0
,
(
int32_t
)
pQuery
->
rec
.
capacity
,
pQuery
->
numOfOutput
,
&
pQuery
->
interval
,
(
int8_t
)
pQuery
->
precision
,
pQuery
->
fillType
,
pColInfo
);
pQuery
->
interval
.
sliding
,
pQuery
->
interval
.
slidingUnit
,
(
int8_t
)
pQuery
->
precision
,
pQuery
->
fillType
,
pColInfo
);
}
setQueryStatus
(
pQuery
,
QUERY_NOT_COMPLETED
);
...
...
src/query/src/qFill.c
浏览文件 @
2d62f182
...
...
@@ -23,7 +23,7 @@
#define FILL_IS_ASC_FILL(_f) ((_f)->order == TSDB_ORDER_ASC)
SFillInfo
*
taosInitFillInfo
(
int32_t
order
,
TSKEY
skey
,
int32_t
numOfTags
,
int32_t
capacity
,
int32_t
numOfCols
,
SInterval
*
pInterval
,
int8_t
precision
,
int32_t
fillType
,
SFillColInfo
*
pFillCol
)
{
int64_t
slidingTime
,
int8_t
slidingUnit
,
int8_t
precision
,
int32_t
fillType
,
SFillColInfo
*
pFillCol
)
{
if
(
fillType
==
TSDB_FILL_NONE
)
{
return
NULL
;
}
...
...
@@ -38,7 +38,11 @@ SFillInfo* taosInitFillInfo(int32_t order, TSKEY skey, int32_t numOfTags, int32_
pFillInfo
->
numOfTags
=
numOfTags
;
pFillInfo
->
numOfCols
=
numOfCols
;
pFillInfo
->
precision
=
precision
;
memcpy
(
&
pFillInfo
->
interval
,
pInterval
,
sizeof
(
SInterval
));
pFillInfo
->
interval
.
interval
=
slidingTime
;
pFillInfo
->
interval
.
intervalUnit
=
slidingUnit
;
pFillInfo
->
interval
.
sliding
=
slidingTime
;
pFillInfo
->
interval
.
slidingUnit
=
slidingUnit
;
pFillInfo
->
pData
=
malloc
(
POINTER_BYTES
*
numOfCols
);
if
(
numOfTags
>
0
)
{
...
...
src/sync/src/syncMain.c
浏览文件 @
2d62f182
...
...
@@ -511,9 +511,9 @@ static SSyncPeer *syncAddPeer(SSyncNode *pNode, const SNodeInfo *pInfo) {
sInfo
(
"%s, it is configured"
,
pPeer
->
id
);
int
ret
=
strcmp
(
pPeer
->
fqdn
,
tsNodeFqdn
);
if
(
pPeer
->
nodeId
==
0
||
(
ret
>
0
)
||
(
ret
==
0
&&
pPeer
->
port
>
tsSyncPort
))
{
sDebug
(
"%s, start to check peer connection"
,
pPeer
->
id
);
int32_t
checkMs
=
100
+
(
pNode
->
vgId
*
10
)
%
100
;
if
(
pNode
->
vgId
)
checkMs
=
tsStatusInterval
*
2000
+
100
;
if
(
pNode
->
vgId
>
1
)
checkMs
=
tsStatusInterval
*
2000
+
checkMs
;
sDebug
(
"%s, start to check peer connection after %d ms"
,
pPeer
->
id
,
checkMs
);
taosTmrReset
(
syncCheckPeerConnection
,
checkMs
,
pPeer
,
syncTmrCtrl
,
&
pPeer
->
timer
);
}
...
...
tests/pytest/client/twoClients.py
0 → 100644
浏览文件 @
2d62f182
###################################################################
# 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
os
import
sys
sys
.
path
.
insert
(
0
,
os
.
getcwd
())
from
util.log
import
*
from
util.sql
import
*
from
util.dnodes
import
*
import
taos
class
TwoClients
:
def
initConnection
(
self
):
self
.
host
=
"127.0.0.1"
self
.
user
=
"root"
self
.
password
=
"taosdata"
self
.
config
=
"/home/xp/git/TDengine/sim/dnode1/cfg"
def
run
(
self
):
tdDnodes
.
init
(
""
)
tdDnodes
.
setTestCluster
(
False
)
tdDnodes
.
setValgrind
(
False
)
tdDnodes
.
stopAll
()
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
# first client create a stable and insert data
conn1
=
taos
.
connect
(
self
.
host
,
self
.
user
,
self
.
password
,
self
.
config
)
cursor1
=
conn1
.
cursor
()
cursor1
.
execute
(
"drop database if exists db"
)
cursor1
.
execute
(
"create database db"
)
cursor1
.
execute
(
"use db"
)
cursor1
.
execute
(
"create table tb (ts timestamp, id int) tags(loc nchar(30))"
)
cursor1
.
execute
(
"insert into t0 using tb tags('beijing') values(now, 1)"
)
# second client alter the table created by cleint
conn2
=
taos
.
connect
(
self
.
host
,
self
.
user
,
self
.
password
,
self
.
config
)
cursor2
=
conn2
.
cursor
()
cursor2
.
execute
(
"use db"
)
cursor2
.
execute
(
"alter table tb add column name nchar(30)"
)
# first client should not be able to use the origin metadata
tdSql
.
init
(
cursor1
,
True
)
tdSql
.
error
(
"insert into t0 values(now, 2)"
)
# first client should be able to insert data with udpated medadata
tdSql
.
execute
(
"insert into t0 values(now, 2, 'test')"
)
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkRows
(
2
)
# second client drop the table
cursor2
.
execute
(
"drop table t0"
)
cursor2
.
execute
(
"create table t0 using tb tags('beijing')"
)
tdSql
.
execute
(
"insert into t0 values(now, 2, 'test')"
)
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkRows
(
1
)
# error expected for two clients drop the same cloumn
cursor2
.
execute
(
"alter table tb drop column name"
)
tdSql
.
error
(
"alter table tb drop column name"
)
cursor2
.
execute
(
"alter table tb add column speed int"
)
tdSql
.
error
(
"alter table tb add column speed int"
)
tdSql
.
execute
(
"alter table tb add column size int"
)
tdSql
.
query
(
"describe tb"
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"ts"
)
tdSql
.
checkData
(
1
,
0
,
"id"
)
tdSql
.
checkData
(
2
,
0
,
"speed"
)
tdSql
.
checkData
(
3
,
0
,
"size"
)
tdSql
.
checkData
(
4
,
0
,
"loc"
)
cursor1
.
close
()
cursor2
.
close
()
conn1
.
close
()
conn2
.
close
()
clients
=
TwoClients
()
clients
.
initConnection
()
clients
.
run
()
\ No newline at end of file
tests/pytest/fulltest.sh
浏览文件 @
2d62f182
...
...
@@ -187,6 +187,7 @@ python3 ./test.py -f functions/function_top.py
#python3 ./test.py -f functions/function_twa.py
python3 queryCount.py
python3 ./test.py
-f
query/queryGroupbyWithInterval.py
python3 client/twoClients.py
# tools
python3 test.py
-f
tools/taosdemo.py
tests/script/general/http/chunked.sim
浏览文件 @
2d62f182
...
...
@@ -3,7 +3,7 @@ sleep 3000
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c maxSQLLength -v
7
340032
system sh/cfg.sh -n dnode1 -c maxSQLLength -v 340032
system sh/exec.sh -n dnode1 -s start
sleep 3000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录