Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
98fc185e
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1183
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98fc185e
编写于
8月 18, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: escape character problem in auto create table insert
上级
0383ff3d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
98 addition
and
49 deletion
+98
-49
include/libs/nodes/nodes.h
include/libs/nodes/nodes.h
+3
-3
include/util/tdef.h
include/util/tdef.h
+4
-2
source/common/src/systable.c
source/common/src/systable.c
+1
-1
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+2
-2
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+1
-2
source/libs/nodes/src/nodesToSQLFuncs.c
source/libs/nodes/src/nodesToSQLFuncs.c
+85
-37
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+2
-2
未找到文件。
include/libs/nodes/nodes.h
浏览文件 @
98fc185e
...
...
@@ -105,7 +105,7 @@ typedef enum ENodeType {
QUERY_NODE_COLUMN_REF
,
// Statement nodes are used in parser and planner module.
QUERY_NODE_SET_OPERATOR
,
QUERY_NODE_SET_OPERATOR
=
100
,
QUERY_NODE_SELECT_STMT
,
QUERY_NODE_VNODE_MODIF_STMT
,
QUERY_NODE_CREATE_DATABASE_STMT
,
...
...
@@ -198,7 +198,7 @@ typedef enum ENodeType {
QUERY_NODE_QUERY
,
// logic plan node
QUERY_NODE_LOGIC_PLAN_SCAN
,
QUERY_NODE_LOGIC_PLAN_SCAN
=
1000
,
QUERY_NODE_LOGIC_PLAN_JOIN
,
QUERY_NODE_LOGIC_PLAN_AGG
,
QUERY_NODE_LOGIC_PLAN_PROJECT
,
...
...
@@ -215,7 +215,7 @@ typedef enum ENodeType {
QUERY_NODE_LOGIC_PLAN
,
// physical plan node
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
=
1100
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
,
...
...
include/util/tdef.h
浏览文件 @
98fc185e
...
...
@@ -133,7 +133,6 @@ typedef enum EOperatorType {
OP_TYPE_REM
,
// unary arithmetic operator
OP_TYPE_MINUS
,
OP_TYPE_ASSIGN
,
// bitwise operator
OP_TYPE_BIT_AND
,
...
...
@@ -164,7 +163,10 @@ typedef enum EOperatorType {
// json operator
OP_TYPE_JSON_GET_VALUE
,
OP_TYPE_JSON_CONTAINS
OP_TYPE_JSON_CONTAINS
,
// internal operator
OP_TYPE_ASSIGN
}
EOperatorType
;
#define OP_TYPE_CALC_MAX OP_TYPE_BIT_OR
...
...
source/common/src/systable.c
浏览文件 @
98fc185e
...
...
@@ -88,7 +88,7 @@ static const SSysDbTableSchema userDBSchema[] = {
{.
name
=
"comp"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"retention"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"retention
s
"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"single_stable"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
{.
name
=
"cachemodel"
,
.
bytes
=
TSDB_CACHE_MODEL_STR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"cachesize"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
98fc185e
...
...
@@ -205,7 +205,7 @@ typedef struct SExprSupp {
}
SExprSupp
;
typedef
struct
SOperatorInfo
{
uint
8_t
operatorType
;
uint
16_t
operatorType
;
bool
blocking
;
// block operator or not
uint8_t
status
;
// denote if current operator is completed
char
*
name
;
// name, for debug purpose
...
...
@@ -434,7 +434,7 @@ typedef struct SStreamAggSupporter {
typedef
struct
SessionWindowSupporter
{
SStreamAggSupporter
*
pStreamAggSup
;
int64_t
gap
;
uint
8_t
parentType
;
uint
16_t
parentType
;
SAggSupporter
*
pIntervalAggSup
;
}
SessionWindowSupporter
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
98fc185e
...
...
@@ -1780,7 +1780,7 @@ void increaseTs(SqlFunctionCtx* pCtx) {
}
}
void
initIntervalDownStream
(
SOperatorInfo
*
downstream
,
uint
8
_t
type
,
SAggSupporter
*
pSup
)
{
void
initIntervalDownStream
(
SOperatorInfo
*
downstream
,
uint
16
_t
type
,
SAggSupporter
*
pSup
)
{
if
(
downstream
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
// Todo(liuyao) support partition by column
return
;
...
...
@@ -2644,7 +2644,6 @@ void destroyTimeSliceOperatorInfo(void* param, int32_t numOfOutput) {
taosMemoryFreeClear
(
param
);
}
SOperatorInfo
*
createTimeSliceOperatorInfo
(
SOperatorInfo
*
downstream
,
SPhysiNode
*
pPhyNode
,
SExecTaskInfo
*
pTaskInfo
)
{
STimeSliceOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
STimeSliceOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
...
...
source/libs/nodes/src/nodesToSQLFuncs.c
浏览文件 @
98fc185e
...
...
@@ -21,36 +21,89 @@
#include "taoserror.h"
#include "thash.h"
char
*
gOperatorStr
[]
=
{
NULL
,
"+"
,
"-"
,
"*"
,
"/"
,
"%"
,
"-"
,
"&"
,
"|"
,
">"
,
">="
,
"<"
,
"<="
,
"="
,
"<>"
,
"IN"
,
"NOT IN"
,
"LIKE"
,
"NOT LIKE"
,
"MATCH"
,
"NMATCH"
,
"IS NULL"
,
"IS NOT NULL"
,
"IS TRUE"
,
"IS FALSE"
,
"IS UNKNOWN"
,
"IS NOT TRUE"
,
"IS NOT FALSE"
,
"IS NOT UNKNOWN"
};
char
*
gLogicConditionStr
[]
=
{
"AND"
,
"OR"
,
"NOT"
};
static
const
char
*
operatorTypeStr
(
EOperatorType
type
)
{
switch
(
type
)
{
case
OP_TYPE_ADD
:
return
"+"
;
case
OP_TYPE_SUB
:
return
"-"
;
case
OP_TYPE_MULTI
:
return
"*"
;
case
OP_TYPE_DIV
:
return
"/"
;
case
OP_TYPE_REM
:
return
"%"
;
case
OP_TYPE_MINUS
:
return
"-"
;
case
OP_TYPE_BIT_AND
:
return
"&"
;
case
OP_TYPE_BIT_OR
:
return
"|"
;
case
OP_TYPE_GREATER_THAN
:
return
">"
;
case
OP_TYPE_GREATER_EQUAL
:
return
">="
;
case
OP_TYPE_LOWER_THAN
:
return
"<"
;
case
OP_TYPE_LOWER_EQUAL
:
return
"<="
;
case
OP_TYPE_EQUAL
:
return
"="
;
case
OP_TYPE_NOT_EQUAL
:
return
"<>"
;
case
OP_TYPE_IN
:
return
"IN"
;
case
OP_TYPE_NOT_IN
:
return
"NOT IN"
;
case
OP_TYPE_LIKE
:
return
"LIKE"
;
case
OP_TYPE_NOT_LIKE
:
return
"NOT LIKE"
;
case
OP_TYPE_MATCH
:
return
"MATCH"
;
case
OP_TYPE_NMATCH
:
return
"NMATCH"
;
case
OP_TYPE_IS_NULL
:
return
"IS NULL"
;
case
OP_TYPE_IS_NOT_NULL
:
return
"IS NOT NULL"
;
case
OP_TYPE_IS_TRUE
:
return
"IS TRUE"
;
case
OP_TYPE_IS_FALSE
:
return
"IS FALSE"
;
case
OP_TYPE_IS_UNKNOWN
:
return
"IS UNKNOWN"
;
case
OP_TYPE_IS_NOT_TRUE
:
return
"IS NOT TRUE"
;
case
OP_TYPE_IS_NOT_FALSE
:
return
"IS NOT FALSE"
;
case
OP_TYPE_IS_NOT_UNKNOWN
:
return
"IS NOT UNKNOWN"
;
case
OP_TYPE_JSON_GET_VALUE
:
return
"=>"
;
case
OP_TYPE_JSON_CONTAINS
:
return
"CONTAINS"
;
case
OP_TYPE_ASSIGN
:
return
"="
;
default:
break
;
}
return
"UNKNOWN"
;
}
static
const
char
*
logicConditionTypeStr
(
ELogicConditionType
type
)
{
switch
(
type
)
{
case
LOGIC_COND_TYPE_AND
:
return
"AND"
;
case
LOGIC_COND_TYPE_OR
:
return
"OR"
;
case
LOGIC_COND_TYPE_NOT
:
return
"NOT"
;
default:
break
;
}
return
"UNKNOWN"
;
}
int32_t
nodesNodeToSQL
(
SNode
*
pNode
,
char
*
buf
,
int32_t
bufSize
,
int32_t
*
len
)
{
switch
(
pNode
->
type
)
{
...
...
@@ -94,12 +147,7 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) {
NODES_ERR_RET
(
nodesNodeToSQL
(
pOpNode
->
pLeft
,
buf
,
bufSize
,
len
));
}
if
(
pOpNode
->
opType
>=
(
sizeof
(
gOperatorStr
)
/
sizeof
(
gOperatorStr
[
0
])))
{
nodesError
(
"unknown operation type:%d"
,
pOpNode
->
opType
);
NODES_ERR_RET
(
TSDB_CODE_QRY_APP_ERROR
);
}
*
len
+=
snprintf
(
buf
+
*
len
,
bufSize
-
*
len
,
" %s "
,
gOperatorStr
[
pOpNode
->
opType
]);
*
len
+=
snprintf
(
buf
+
*
len
,
bufSize
-
*
len
,
" %s "
,
operatorTypeStr
(
pOpNode
->
opType
));
if
(
pOpNode
->
pRight
)
{
NODES_ERR_RET
(
nodesNodeToSQL
(
pOpNode
->
pRight
,
buf
,
bufSize
,
len
));
...
...
@@ -118,7 +166,7 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) {
FOREACH
(
node
,
pLogicNode
->
pParameterList
)
{
if
(
!
first
)
{
*
len
+=
snprintf
(
buf
+
*
len
,
bufSize
-
*
len
,
" %s "
,
gLogicConditionStr
[
pLogicNode
->
condType
]
);
*
len
+=
snprintf
(
buf
+
*
len
,
bufSize
-
*
len
,
" %s "
,
logicConditionTypeStr
(
pLogicNode
->
condType
)
);
}
NODES_ERR_RET
(
nodesNodeToSQL
(
node
,
buf
,
bufSize
,
len
));
first
=
false
;
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
98fc185e
...
...
@@ -143,9 +143,9 @@ static int32_t createSName(SName* pName, SToken* pTableName, int32_t acctId, con
}
char
name
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
strncpy
(
name
,
pTableName
->
z
,
dbLen
);
d
bLen
=
strdequote
(
name
);
int32_t
actualD
bLen
=
strdequote
(
name
);
code
=
tNameSetDbName
(
pName
,
acctId
,
name
,
d
bLen
);
code
=
tNameSetDbName
(
pName
,
acctId
,
name
,
actualD
bLen
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg1
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录