Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
1e7fd87d
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看板
提交
1e7fd87d
编写于
6月 04, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
td-459: TSDB_COL_NAME_LEN
上级
daafb42e
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
43 addition
and
42 deletion
+43
-42
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+9
-9
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+18
-17
src/client/src/tscSchemaUtil.c
src/client/src/tscSchemaUtil.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+3
-3
src/connector/python/linux/python3/taos/cinterface.py
src/connector/python/linux/python3/taos/cinterface.py
+3
-3
src/inc/taos.h
src/inc/taos.h
+2
-2
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-1
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+2
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+2
-2
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
1e7fd87d
...
...
@@ -132,7 +132,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
TAOS_FIELD
*
pField
=
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
0
);
char
*
dst
=
pRes
->
data
+
tscFieldInfoGetOffset
(
pQueryInfo
,
0
)
*
totalNumOfRows
+
pField
->
bytes
*
i
;
STR_WITH_MAXSIZE_TO_VARSTR
(
dst
,
pSchema
[
i
].
name
,
TSDB_COL_NAME_LEN
);
STR_WITH_MAXSIZE_TO_VARSTR
(
dst
,
pSchema
[
i
].
name
,
TSDB_COL_NAME_LEN
-
1
);
char
*
type
=
tDataTypeDesc
[
pSchema
[
i
].
type
].
aName
;
...
...
@@ -171,7 +171,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
// field name
TAOS_FIELD
*
pField
=
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
0
);
char
*
output
=
pRes
->
data
+
tscFieldInfoGetOffset
(
pQueryInfo
,
0
)
*
totalNumOfRows
+
pField
->
bytes
*
i
;
STR_WITH_MAXSIZE_TO_VARSTR
(
output
,
pSchema
[
i
].
name
,
TSDB_COL_NAME_LEN
);
STR_WITH_MAXSIZE_TO_VARSTR
(
output
,
pSchema
[
i
].
name
,
TSDB_COL_NAME_LEN
-
1
);
// type name
pField
=
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
1
);
...
...
@@ -211,18 +211,18 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSql
->
cmd
,
0
);
pQueryInfo
->
order
.
order
=
TSDB_ORDER_ASC
;
TAOS_FIELD
f
=
{.
type
=
TSDB_DATA_TYPE_BINARY
,
.
bytes
=
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
};
strncpy
(
f
.
name
,
"Field"
,
TSDB_COL_NAME_LEN
);
TAOS_FIELD
f
=
{.
type
=
TSDB_DATA_TYPE_BINARY
,
.
bytes
=
(
TSDB_COL_NAME_LEN
-
1
)
+
VARSTR_HEADER_SIZE
};
tstrncpy
(
f
.
name
,
"Field"
,
sizeof
(
f
.
name
)
);
SFieldSupInfo
*
pInfo
=
tscFieldInfoAppend
(
&
pQueryInfo
->
fieldsInfo
,
&
f
);
pInfo
->
pSqlExpr
=
tscSqlExprAppend
(
pQueryInfo
,
TSDB_FUNC_TS_DUMMY
,
&
index
,
TSDB_DATA_TYPE_BINARY
,
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
,
TSDB_COL_NAME_LEN
,
false
);
(
TSDB_COL_NAME_LEN
-
1
)
+
VARSTR_HEADER_SIZE
,
(
TSDB_COL_NAME_LEN
-
1
)
,
false
);
rowLen
+=
(
TSDB_COL_NAME_LEN
+
VARSTR_HEADER_SIZE
);
rowLen
+=
(
(
TSDB_COL_NAME_LEN
-
1
)
+
VARSTR_HEADER_SIZE
);
f
.
bytes
=
typeColLength
;
f
.
type
=
TSDB_DATA_TYPE_BINARY
;
strncpy
(
f
.
name
,
"Type"
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
f
.
name
,
"Type"
,
sizeof
(
f
.
name
)
);
pInfo
=
tscFieldInfoAppend
(
&
pQueryInfo
->
fieldsInfo
,
&
f
);
pInfo
->
pSqlExpr
=
tscSqlExprAppend
(
pQueryInfo
,
TSDB_FUNC_TS_DUMMY
,
&
index
,
TSDB_DATA_TYPE_BINARY
,
typeColLength
,
...
...
@@ -232,7 +232,7 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
f
.
bytes
=
sizeof
(
int32_t
);
f
.
type
=
TSDB_DATA_TYPE_INT
;
strncpy
(
f
.
name
,
"Length"
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
f
.
name
,
"Length"
,
sizeof
(
f
.
name
)
);
pInfo
=
tscFieldInfoAppend
(
&
pQueryInfo
->
fieldsInfo
,
&
f
);
pInfo
->
pSqlExpr
=
tscSqlExprAppend
(
pQueryInfo
,
TSDB_FUNC_TS_DUMMY
,
&
index
,
TSDB_DATA_TYPE_INT
,
sizeof
(
int32_t
),
...
...
@@ -242,7 +242,7 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
f
.
bytes
=
noteColLength
;
f
.
type
=
TSDB_DATA_TYPE_BINARY
;
strncpy
(
f
.
name
,
"Note"
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
f
.
name
,
"Note"
,
sizeof
(
f
.
name
)
);
pInfo
=
tscFieldInfoAppend
(
&
pQueryInfo
->
fieldsInfo
,
&
f
);
pInfo
->
pSqlExpr
=
tscSqlExprAppend
(
pQueryInfo
,
TSDB_FUNC_TS_DUMMY
,
&
index
,
TSDB_DATA_TYPE_BINARY
,
noteColLength
,
...
...
src/client/src/tscSQLParser.c
浏览文件 @
1e7fd87d
...
...
@@ -933,7 +933,7 @@ bool validateOneTags(SSqlCmd* pCmd, TAOS_FIELD* pTagField) {
SSchema
*
pSchema
=
tscGetTableSchema
(
pTableMeta
);
for
(
int32_t
i
=
0
;
i
<
numOfTags
+
numOfCols
;
++
i
)
{
if
(
strncasecmp
(
pTagField
->
name
,
pSchema
[
i
].
name
,
TSDB_COL_NAME_LEN
)
==
0
)
{
if
(
strncasecmp
(
pTagField
->
name
,
pSchema
[
i
].
name
,
sizeof
(
pTagField
->
name
)
-
1
)
==
0
)
{
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
return
false
;
}
...
...
@@ -993,7 +993,7 @@ bool validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) {
// field name must be unique
for
(
int32_t
i
=
0
;
i
<
numOfTags
+
numOfCols
;
++
i
)
{
if
(
strncasecmp
(
pColField
->
name
,
pSchema
[
i
].
name
,
TSDB_COL_NAME_LEN
)
==
0
)
{
if
(
strncasecmp
(
pColField
->
name
,
pSchema
[
i
].
name
,
sizeof
(
pColField
->
name
)
-
1
)
==
0
)
{
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
return
false
;
}
...
...
@@ -1005,7 +1005,8 @@ bool validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) {
/* is contained in pFieldList or not */
static
bool
has
(
tFieldList
*
pFieldList
,
int32_t
startIdx
,
const
char
*
name
)
{
for
(
int32_t
j
=
startIdx
;
j
<
pFieldList
->
nField
;
++
j
)
{
if
(
strncasecmp
(
name
,
pFieldList
->
p
[
j
].
name
,
TSDB_COL_NAME_LEN
)
==
0
)
return
true
;
TAOS_FIELD
*
field
=
pFieldList
->
p
+
j
;
if
(
strncasecmp
(
name
,
field
->
name
,
sizeof
(
field
->
name
)
-
1
)
==
0
)
return
true
;
}
return
false
;
...
...
@@ -1166,7 +1167,7 @@ int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, tSQLExprList* pSel
/* todo alias name should use the original sql string */
char
*
name
=
(
pItem
->
aliasName
!=
NULL
)
?
pItem
->
aliasName
:
arithmeticExprStr
;
strncpy
(
pExpr
->
aliasName
,
name
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
pExpr
->
aliasName
,
name
,
sizeof
(
pExpr
->
aliasName
)
);
tExprNode
*
pNode
=
NULL
;
SArray
*
colList
=
taosArrayInit
(
10
,
sizeof
(
SColIndex
));
...
...
@@ -1448,7 +1449,7 @@ static int32_t setExprInfoForFunctions(SQueryInfo* pQueryInfo, SSchema* pSchema,
if
(
aliasName
!=
NULL
)
{
strcpy
(
columnName
,
aliasName
);
}
else
{
getRevisedName
(
columnName
,
functionID
,
TSDB_COL_NAME_LEN
,
pSchema
[
pColIndex
->
columnIndex
].
name
);
getRevisedName
(
columnName
,
functionID
,
sizeof
(
columnName
)
-
1
,
pSchema
[
pColIndex
->
columnIndex
].
name
);
}
SSqlExpr
*
pExpr
=
tscSqlExprAppend
(
pQueryInfo
,
functionID
,
pColIndex
,
type
,
bytes
,
bytes
,
false
);
...
...
@@ -1536,7 +1537,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
}
memset
(
pExpr
->
aliasName
,
0
,
tListLen
(
pExpr
->
aliasName
));
getColumnName
(
pItem
,
pExpr
->
aliasName
,
TSDB_COL_NAME_LEN
);
getColumnName
(
pItem
,
pExpr
->
aliasName
,
sizeof
(
pExpr
->
aliasName
)
-
1
);
SColumnList
ids
=
getColumnList
(
1
,
index
.
tableIndex
,
index
.
columnIndex
);
if
(
finalResult
)
{
...
...
@@ -1651,7 +1652,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
ids
.
ids
[
0
]
=
index
;
memset
(
pExpr
->
aliasName
,
0
,
tListLen
(
pExpr
->
aliasName
));
getColumnName
(
pItem
,
pExpr
->
aliasName
,
TSDB_COL_NAME_LEN
);
getColumnName
(
pItem
,
pExpr
->
aliasName
,
sizeof
(
pExpr
->
aliasName
)
-
1
);
if
(
finalResult
)
{
int32_t
numOfOutput
=
tscNumOfFields
(
pQueryInfo
);
...
...
@@ -1851,7 +1852,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
}
memset
(
pExpr
->
aliasName
,
0
,
tListLen
(
pExpr
->
aliasName
));
getColumnName
(
pItem
,
pExpr
->
aliasName
,
TSDB_COL_NAME_LEN
);
getColumnName
(
pItem
,
pExpr
->
aliasName
,
sizeof
(
pExpr
->
aliasName
)
-
1
);
SColumnList
ids
=
getColumnList
(
1
,
0
,
index
.
columnIndex
);
if
(
finalResult
)
{
...
...
@@ -3997,7 +3998,7 @@ int32_t tsRewriteFieldNameIfNecessary(SQueryInfo* pQueryInfo) {
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
fieldsInfo
.
numOfOutput
;
++
i
)
{
char
*
fieldName
=
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
i
)
->
name
;
for
(
int32_t
j
=
0
;
j
<
TSDB_COL_NAME_LEN
&&
fieldName
[
j
]
!=
0
;
++
j
)
{
for
(
int32_t
j
=
0
;
j
<
(
TSDB_COL_NAME_LEN
-
1
)
&&
fieldName
[
j
]
!=
0
;
++
j
)
{
for
(
int32_t
k
=
0
;
k
<
tListLen
(
rep
);
++
k
)
{
if
(
fieldName
[
j
]
==
rep
[
k
])
{
fieldName
[
j
]
=
'_'
;
...
...
@@ -4013,7 +4014,7 @@ int32_t tsRewriteFieldNameIfNecessary(SQueryInfo* pQueryInfo) {
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
fieldsInfo
.
numOfOutput
;
++
i
)
{
char
*
fieldName
=
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
i
)
->
name
;
for
(
int32_t
j
=
i
+
1
;
j
<
pQueryInfo
->
fieldsInfo
.
numOfOutput
;
++
j
)
{
if
(
strncasecmp
(
fieldName
,
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
j
)
->
name
,
TSDB_COL_NAME_LEN
)
==
0
)
{
if
(
strncasecmp
(
fieldName
,
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
j
)
->
name
,
(
TSDB_COL_NAME_LEN
-
1
)
)
==
0
)
{
const
char
*
msg
=
"duplicated column name in new table"
;
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg
);
}
...
...
@@ -4368,7 +4369,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
tVariantListItem
*
pItem
=
&
pAlterSQL
->
varList
->
a
[
0
];
if
(
pItem
->
pVar
.
nLen
>
TSDB_COL_NAME_LEN
)
{
if
(
pItem
->
pVar
.
nLen
>
=
TSDB_COL_NAME_LEN
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg9
);
}
...
...
@@ -4420,7 +4421,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return
TSDB_CODE_TSC_INVALID_SQL
;
}
char
name
[
TSDB_COL_NAME_LEN
+
1
]
=
{
0
};
char
name
[
TSDB_COL_NAME_LEN
]
=
{
0
};
strncpy
(
name
,
pVarList
->
a
[
0
].
pVar
.
pz
,
pVarList
->
a
[
0
].
pVar
.
nLen
);
TAOS_FIELD
f
=
tscCreateField
(
TSDB_DATA_TYPE_INT
,
name
,
tDataTypeDesc
[
TSDB_DATA_TYPE_INT
].
nSize
);
tscFieldInfoAppend
(
&
pQueryInfo
->
fieldsInfo
,
&
f
);
...
...
@@ -4522,8 +4523,8 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg18
);
}
char
name1
[
TSDB_COL_NAME_LEN
+
1
]
=
{
0
};
strncpy
(
name1
,
pItem
->
pVar
.
pz
,
pItem
->
pVar
.
nLen
);
char
name1
[
TSDB_COL_NAME_LEN
]
=
{
0
};
tstrncpy
(
name1
,
pItem
->
pVar
.
pz
,
sizeof
(
name1
)
);
TAOS_FIELD
f
=
tscCreateField
(
TSDB_DATA_TYPE_INT
,
name1
,
tDataTypeDesc
[
TSDB_DATA_TYPE_INT
].
nSize
);
tscFieldInfoAppend
(
&
pQueryInfo
->
fieldsInfo
,
&
f
);
}
...
...
@@ -5254,8 +5255,8 @@ static int32_t doAddGroupbyColumnsOnDemand(SQueryInfo* pQueryInfo) {
SColumnIndex
index
=
{.
tableIndex
=
pQueryInfo
->
groupbyExpr
.
tableIndex
,
.
columnIndex
=
colIndex
};
SSqlExpr
*
pExpr
=
tscSqlExprAppend
(
pQueryInfo
,
TSDB_FUNC_TAG
,
&
index
,
type
,
bytes
,
bytes
,
true
);
memset
(
pExpr
->
aliasName
,
0
,
tListLen
(
pExpr
->
aliasName
));
strncpy
(
pExpr
->
aliasName
,
name
,
TSDB_COL_NAME_LEN
);
memset
(
pExpr
->
aliasName
,
0
,
sizeof
(
pExpr
->
aliasName
));
tstrncpy
(
pExpr
->
aliasName
,
name
,
sizeof
(
pExpr
->
aliasName
)
);
pExpr
->
colInfo
.
flag
=
TSDB_COL_TAG
;
...
...
@@ -6019,7 +6020,7 @@ int32_t exprTreeFromSqlExpr(tExprNode **pExpr, const tSQLExpr* pSqlExpr, SArray*
if
(
pCols
!=
NULL
)
{
// record the involved columns
SColIndex
colIndex
=
{
0
};
strncpy
(
colIndex
.
name
,
pSchema
->
name
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
colIndex
.
name
,
pSchema
->
name
,
sizeof
(
colIndex
.
name
)
);
colIndex
.
colId
=
pSchema
->
colId
;
colIndex
.
colIndex
=
index
.
columnIndex
;
...
...
src/client/src/tscSchemaUtil.c
浏览文件 @
1e7fd87d
...
...
@@ -115,7 +115,7 @@ bool isValidSchema(struct SSchema* pSchema, int32_t numOfCols) {
// 3. valid column names
for
(
int32_t
j
=
i
+
1
;
j
<
numOfCols
;
++
j
)
{
if
(
strncasecmp
(
pSchema
[
i
].
name
,
pSchema
[
j
].
name
,
TSDB_COL_NAME_LEN
)
==
0
)
{
if
(
strncasecmp
(
pSchema
[
i
].
name
,
pSchema
[
j
].
name
,
sizeof
(
pSchema
[
i
].
name
)
-
1
)
==
0
)
{
return
false
;
}
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
1e7fd87d
...
...
@@ -1921,7 +1921,7 @@ static char *getArithemicInputSrc(void *param, const char *name, int32_t colId)
for
(
int32_t
i
=
0
;
i
<
pSupport
->
numOfCols
;
++
i
)
{
pExpr
=
taosArrayGetP
(
pSupport
->
exprList
,
i
);
if
(
strncmp
(
name
,
pExpr
->
aliasName
,
TSDB_COL_NAME_LEN
)
==
0
)
{
if
(
strncmp
(
name
,
pExpr
->
aliasName
,
sizeof
(
pExpr
->
aliasName
)
-
1
)
==
0
)
{
index
=
i
;
break
;
}
...
...
src/client/src/tscUtil.c
浏览文件 @
1e7fd87d
...
...
@@ -801,7 +801,7 @@ int tscAllocPayload(SSqlCmd* pCmd, int size) {
TAOS_FIELD
tscCreateField
(
int8_t
type
,
const
char
*
name
,
int16_t
bytes
)
{
TAOS_FIELD
f
=
{
.
type
=
type
,
.
bytes
=
bytes
,
};
strncpy
(
f
.
name
,
name
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
f
.
name
,
name
,
sizeof
(
f
.
name
)
);
return
f
;
}
...
...
@@ -966,12 +966,12 @@ static SSqlExpr* doBuildSqlExpr(SQueryInfo* pQueryInfo, int16_t functionId, SCol
if
(
isTagCol
)
{
SSchema
*
pSchema
=
tscGetTableTagSchema
(
pTableMetaInfo
->
pTableMeta
);
pExpr
->
colInfo
.
colId
=
pSchema
[
pColIndex
->
columnIndex
].
colId
;
strncpy
(
pExpr
->
colInfo
.
name
,
pSchema
[
pColIndex
->
columnIndex
].
name
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
pExpr
->
colInfo
.
name
,
pSchema
[
pColIndex
->
columnIndex
].
name
,
sizeof
(
pExpr
->
colInfo
.
name
)
);
}
else
if
(
pTableMetaInfo
->
pTableMeta
!=
NULL
)
{
// in handling select database/version/server_status(), the pTableMeta is NULL
SSchema
*
pSchema
=
tscGetTableColumnSchema
(
pTableMetaInfo
->
pTableMeta
,
pColIndex
->
columnIndex
);
pExpr
->
colInfo
.
colId
=
pSchema
->
colId
;
strncpy
(
pExpr
->
colInfo
.
name
,
pSchema
->
name
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
pExpr
->
colInfo
.
name
,
pSchema
->
name
,
sizeof
(
pExpr
->
colInfo
.
name
)
);
}
}
...
...
src/connector/python/linux/python3/taos/cinterface.py
浏览文件 @
1e7fd87d
...
...
@@ -130,9 +130,9 @@ _CONVERT_FUNC = {
# Corresponding TAOS_FIELD structure in C
class
TaosField
(
ctypes
.
Structure
):
_fields_
=
[(
'name'
,
ctypes
.
c_char
*
6
4
),
(
'
bytes'
,
ctypes
.
c_short
),
(
'
type'
,
ctypes
.
c_char
)]
_fields_
=
[(
'name'
,
ctypes
.
c_char
*
6
5
),
(
'
type'
,
ctypes
.
c_char
),
(
'
bytes'
,
ctypes
.
c_short
)]
# C interface class
class
CTaosInterface
(
object
):
...
...
src/inc/taos.h
浏览文件 @
1e7fd87d
...
...
@@ -53,9 +53,9 @@ typedef enum {
}
TSDB_OPTION
;
typedef
struct
taosField
{
char
name
[
64
];
short
bytes
;
char
name
[
65
];
uint8_t
type
;
short
bytes
;
}
TAOS_FIELD
;
#ifdef _TD_GO_DLL_
...
...
src/inc/taosdef.h
浏览文件 @
1e7fd87d
...
...
@@ -202,7 +202,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_NODE_NAME_LEN 64
#define TSDB_TABLE_NAME_LEN 193
#define TSDB_DB_NAME_LEN 33
#define TSDB_COL_NAME_LEN 6
4
#define TSDB_COL_NAME_LEN 6
5
#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
...
...
src/inc/taosmsg.h
浏览文件 @
1e7fd87d
...
...
@@ -224,7 +224,7 @@ typedef struct {
typedef
struct
SSchema
{
uint8_t
type
;
char
name
[
TSDB_COL_NAME_LEN
+
1
];
char
name
[
TSDB_COL_NAME_LEN
];
int16_t
colId
;
int16_t
bytes
;
}
SSchema
;
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
1e7fd87d
...
...
@@ -88,14 +88,14 @@ enum _describe_table_index {
};
typedef
struct
{
char
field
[
TSDB_COL_NAME_LEN
+
1
];
char
field
[
TSDB_COL_NAME_LEN
];
char
type
[
16
];
int
length
;
char
note
[
128
];
}
SColDes
;
typedef
struct
{
char
name
[
TSDB_COL_NAME_LEN
+
1
];
char
name
[
TSDB_COL_NAME_LEN
];
SColDes
cols
[];
}
STableDef
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
1e7fd87d
...
...
@@ -951,7 +951,7 @@ static int32_t mnodeModifySuperTableTagName(SSuperTableObj *pStable, char *oldTa
// update
SSchema
*
schema
=
(
SSchema
*
)
(
pStable
->
schema
+
pStable
->
numOfColumns
+
col
);
strncpy
(
schema
->
name
,
newTagName
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
schema
->
name
,
newTagName
,
sizeof
(
schema
->
name
)
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
...
...
@@ -1228,7 +1228,7 @@ static int32_t mnodeSetSchemaFromSuperTable(SSchema *pSchema, SSuperTableObj *pT
assert
(
numOfCols
<=
TSDB_MAX_COLUMNS
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
strncpy
(
pSchema
->
name
,
pTable
->
schema
[
i
].
name
,
TSDB_COL_NAME_LEN
);
tstrncpy
(
pSchema
->
name
,
pTable
->
schema
[
i
].
name
,
sizeof
(
pSchema
->
name
)
);
pSchema
->
type
=
pTable
->
schema
[
i
].
type
;
pSchema
->
bytes
=
htons
(
pTable
->
schema
[
i
].
bytes
);
pSchema
->
colId
=
htons
(
pTable
->
schema
[
i
].
colId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录