Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
20f8aeba
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
20f8aeba
编写于
6月 08, 2021
作者:
Z
zyyang
浏览文件
操作
浏览文件
下载
差异文件
change
上级
1b53460b
84dcaebd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
11 deletion
+29
-11
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+5
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+9
-6
src/client/src/tscStream.c
src/client/src/tscStream.c
+6
-2
src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBPreparedStatementTest.java
...est/java/com/taosdata/jdbc/TSDBPreparedStatementTest.java
+3
-1
src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBResultSetTest.java
...bc/src/test/java/com/taosdata/jdbc/TSDBResultSetTest.java
+2
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+4
-0
未找到文件。
src/client/src/tscParseInsert.c
浏览文件 @
20f8aeba
...
...
@@ -466,6 +466,10 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, SSqlCmd *pCmd, int1
int32_t
cnt
=
0
;
int32_t
j
=
0
;
if
(
sToken
.
n
>=
TSDB_MAX_BYTES_PER_ROW
)
{
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"too long string"
,
sToken
.
z
);
}
for
(
uint32_t
k
=
1
;
k
<
sToken
.
n
-
1
;
++
k
)
{
if
(
sToken
.
z
[
k
]
==
'\\'
||
(
sToken
.
z
[
k
]
==
delim
&&
sToken
.
z
[
k
+
1
]
==
delim
))
{
tmpTokenBuf
[
j
]
=
sToken
.
z
[
k
+
1
];
...
...
@@ -705,7 +709,7 @@ static int32_t doParseInsertStatement(SSqlCmd* pCmd, char **str, STableDataBlock
}
code
=
TSDB_CODE_TSC_INVALID_SQL
;
char
tmpTokenBuf
[
16
*
1024
]
=
{
0
};
// used for deleting Escape character: \\, \', \"
char
tmpTokenBuf
[
TSDB_MAX_BYTES_PER_ROW
]
=
{
0
};
// used for deleting Escape character: \\, \', \"
int32_t
numOfRows
=
0
;
code
=
tsParseValues
(
str
,
dataBuf
,
maxNumOfRows
,
pCmd
,
&
numOfRows
,
tmpTokenBuf
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
20f8aeba
...
...
@@ -314,7 +314,9 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
}
else
if
(
pInfo
->
type
==
TSDB_SQL_DROP_DNODE
)
{
pzName
->
n
=
strdequote
(
pzName
->
z
);
if
(
pzName
->
type
==
TK_STRING
)
{
pzName
->
n
=
strdequote
(
pzName
->
z
);
}
strncpy
(
pCmd
->
payload
,
pzName
->
z
,
pzName
->
n
);
}
else
{
// drop user/account
if
(
pzName
->
n
>=
TSDB_USER_LEN
)
{
...
...
@@ -392,7 +394,9 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
SStrToken
*
id
=
taosArrayGet
(
pInfo
->
pMiscInfo
->
a
,
0
);
id
->
n
=
strdequote
(
id
->
z
);
if
(
id
->
type
==
TK_STRING
)
{
id
->
n
=
strdequote
(
id
->
z
);
}
break
;
}
...
...
@@ -6674,9 +6678,8 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
const
char
*
msg5
=
"sql too long"
;
// todo ADD support
const
char
*
msg6
=
"from missing in subclause"
;
const
char
*
msg7
=
"time interval is required"
;
const
char
*
msg8
=
"query column is required"
;
const
char
*
msg9
=
"the first column must be timestamp type"
;
const
char
*
msg8
=
"the first column should be primary timestamp column"
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
assert
(
pQueryInfo
->
numOfTables
==
1
);
...
...
@@ -6747,7 +6750,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg8
);
}
if
(
pSqlExpr
->
colInfo
.
colId
!=
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
9
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
8
);
}
}
else
{
if
(
pQueryInfo
->
interval
.
interval
==
0
)
{
...
...
src/client/src/tscStream.c
浏览文件 @
20f8aeba
...
...
@@ -340,8 +340,12 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
if
(
pStream
->
isProject
)
{
int64_t
now
=
taosGetTimestamp
(
pStream
->
precision
);
int64_t
etime
=
now
>
pStream
->
etime
?
pStream
->
etime
:
now
;
if
(
pStream
->
etime
<
now
&&
now
-
pStream
->
etime
>
tsMaxRetentWindow
)
{
int64_t
maxRetent
=
tsMaxRetentWindow
*
1000
;
if
(
pStream
->
precision
==
TSDB_TIME_PRECISION_MICRO
)
{
maxRetent
*=
1000
;
}
if
(
pStream
->
etime
<
now
&&
now
-
pStream
->
etime
>
maxRetent
)
{
/*
* current time window will be closed, since it too early to exceed the maxRetentWindow value
*/
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBPreparedStatementTest.java
浏览文件 @
20f8aeba
...
...
@@ -5,6 +5,8 @@ import org.junit.*;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.sql.*
;
import
java.util.ArrayList
;
import
java.util.Random
;
public
class
TSDBPreparedStatementTest
{
...
...
@@ -302,7 +304,7 @@ public class TSDBPreparedStatementTest {
stmt
.
execute
(
"create database dbtest"
);
Assert
.
assertThrows
(
SQLException
.
class
,
()
->
stmt
.
execute
(
"create database dbtest"
));
}
@Test
public
void
setBoolean
()
throws
SQLException
{
// given
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBResultSetTest.java
浏览文件 @
20f8aeba
...
...
@@ -177,7 +177,8 @@ public class TSDBResultSetTest {
rs
.
getAsciiStream
(
"f1"
);
}
@Test
(
expected
=
SQLFeatureNotSupportedException
.
class
)
@SuppressWarnings
(
"deprecation"
)
@Test
(
expected
=
SQLFeatureNotSupportedException
.
class
)
public
void
getUnicodeStream
()
throws
SQLException
{
rs
.
getUnicodeStream
(
"f1"
);
}
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
20f8aeba
...
...
@@ -625,6 +625,10 @@ static int64_t g_totalChildTables = 0;
static
SQueryMetaInfo
g_queryInfo
;
static
FILE
*
g_fpOfInsertResult
=
NULL
;
#if _MSC_VER <= 1900
#define __func__ __FUNCTION__
#endif
#define debugPrint(fmt, ...) \
do { if (g_args.debug_print || g_args.verbose_print) \
fprintf(stderr, "DEBG: "fmt, __VA_ARGS__); } while(0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录