Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9859acf6
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看板
提交
9859acf6
编写于
12月 30, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] fix compiler warning.
上级
82faa5cd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
22 deletion
+36
-22
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+28
-0
source/libs/parser/inc/astGenerator.h
source/libs/parser/inc/astGenerator.h
+0
-1
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+1
-1
source/libs/parser/src/astGenerator.c
source/libs/parser/src/astGenerator.c
+0
-1
source/libs/parser/src/dCDAstProcess.c
source/libs/parser/src/dCDAstProcess.c
+0
-17
source/libs/parser/src/parserUtil.c
source/libs/parser/src/parserUtil.c
+7
-2
未找到文件。
source/client/test/clientTests.cpp
浏览文件 @
9859acf6
...
...
@@ -462,3 +462,31 @@ TEST(testCase, show_table_Test) {
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
TEST
(
testCase
,
create_multiple_tables
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
assert
(
pConn
!=
NULL
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"use abc1"
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table t_2 using st1 tags(1) t_3 using st2 tags(2)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to show vgroups, reason:%s
\n
"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
ASSERT_TRUE
(
false
);
}
TAOS_ROW
pRow
=
NULL
;
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
char
str
[
512
]
=
{
0
};
while
((
pRow
=
taos_fetch_row
(
pRes
))
!=
NULL
)
{
int32_t
code
=
taos_print_row
(
str
,
pRow
,
pFields
,
numOfFields
);
printf
(
"%s
\n
"
,
str
);
}
taos_free_result
(
pRes
);
taos_close
(
pConn
);
}
source/libs/parser/inc/astGenerator.h
浏览文件 @
9859acf6
...
...
@@ -125,7 +125,6 @@ typedef struct SCreatedTableInfo {
SArray
*
pTagNames
;
// create by using super table, tag name
SArray
*
pTagVals
;
// create by using super table, tag value
char
*
fullname
;
// table full name
STagData
tagdata
;
// true tag data, super table full name is in STagData
int8_t
igExist
;
// ignore if exists
}
SCreatedTableInfo
;
...
...
source/libs/parser/inc/sql.y
浏览文件 @
9859acf6
...
...
@@ -188,7 +188,7 @@ cmd ::= COMPACT VNODES IN LP exprlist(Y) RP. { setCompactVnodeSql(pInfo, TSDB
// And "ids" is an identifer-or-string.
%type ids {SToken}
ids(A) ::= ID(X). {A = X; }
ids(A) ::= STRING(X). {A = X; }
//
ids(A) ::= STRING(X). {A = X; }
%type ifexists {SToken}
ifexists(X) ::= IF EXISTS. { X.n = 1;}
...
...
source/libs/parser/src/astGenerator.c
浏览文件 @
9859acf6
...
...
@@ -692,7 +692,6 @@ void freeCreateTableInfo(void* p) {
taosArrayDestroy
(
pInfo
->
pTagNames
);
taosArrayDestroyEx
(
pInfo
->
pTagVals
,
freeItem
);
tfree
(
pInfo
->
fullname
);
tfree
(
pInfo
->
tagdata
.
data
);
}
SSqlInfo
*
setSqlInfo
(
SSqlInfo
*
pInfo
,
void
*
pSqlExprInfo
,
SToken
*
pTableName
,
int32_t
type
)
{
...
...
source/libs/parser/src/dCDAstProcess.c
浏览文件 @
9859acf6
...
...
@@ -363,7 +363,6 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
// too long tag values will return invalid sql, not be truncated automatically
SSchema
*
pTagSchema
=
getTableTagSchema
(
pSuperTableMeta
);
STableComInfo
tinfo
=
getTableInfo
(
pSuperTableMeta
);
STagData
*
pTag
=
&
pCreateTableInfo
->
tagdata
;
SKVRowBuilder
kvRowBuilder
=
{
0
};
if
(
tdInitKVRowBuilder
(
&
kvRowBuilder
)
<
0
)
{
...
...
@@ -463,22 +462,6 @@ int32_t doCheckForCreateCTable(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SMsgBuf* p
SSchema
*
pSchema
=
&
pTagSchema
[
i
];
SToken
*
pItem
=
taosArrayGet
(
pValList
,
i
);
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_BINARY
||
pSchema
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pItem
->
n
>
pSchema
->
bytes
)
{
tdDestroyKVRowBuilder
(
&
kvRowBuilder
);
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg3
);
}
}
else
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
// if (pItem->pVar.nType == TSDB_DATA_TYPE_BINARY) {
//// code = convertTimestampStrToInt64(&(pItem->pVar), tinfo.precision);
// if (code != TSDB_CODE_SUCCESS) {
// return buildInvalidOperationMsg(pMsgBuf, msg4);
// }
// } else if (pItem->pVar.nType == TSDB_DATA_TYPE_TIMESTAMP) {
// pItem->pVar.i = convertTimePrecision(pItem->pVar.i, TSDB_TIME_PRECISION_NANO, tinfo.precision);
// }
}
char
tmpTokenBuf
[
TSDB_MAX_TAGS_LEN
]
=
{
0
};
SKvParam
param
=
{.
builder
=
&
kvRowBuilder
,
.
schema
=
pSchema
};
...
...
source/libs/parser/src/parserUtil.c
浏览文件 @
9859acf6
...
...
@@ -571,7 +571,9 @@ void setColumn(SColumn* pColumn, uint64_t uid, const char* tableName, int8_t fla
pColumn
->
info
.
type
=
pSchema
->
type
;
if
(
tableName
!=
NULL
)
{
snprintf
(
pColumn
->
name
,
tListLen
(
pColumn
->
name
),
"%s.%s"
,
tableName
,
pSchema
->
name
);
char
n
[
TSDB_COL_NAME_LEN
+
1
+
TSDB_TABLE_NAME_LEN
]
=
{
0
};
snprintf
(
n
,
tListLen
(
n
),
"%s.%s"
,
tableName
,
pSchema
->
name
);
tstrncpy
(
pColumn
->
name
,
n
,
tListLen
(
pColumn
->
name
));
}
else
{
tstrncpy
(
pColumn
->
name
,
pSchema
->
name
,
tListLen
(
pColumn
->
name
));
}
...
...
@@ -586,7 +588,10 @@ SColumn createColumn(uint64_t uid, const char* tableName, int8_t flag, const SSc
c
.
info
.
type
=
pSchema
->
type
;
if
(
tableName
!=
NULL
)
{
snprintf
(
c
.
name
,
tListLen
(
c
.
name
),
"%s.%s"
,
tableName
,
pSchema
->
name
);
char
n
[
TSDB_COL_NAME_LEN
+
1
+
TSDB_TABLE_NAME_LEN
]
=
{
0
};
snprintf
(
n
,
tListLen
(
n
),
"%s.%s"
,
tableName
,
pSchema
->
name
);
tstrncpy
(
c
.
name
,
n
,
tListLen
(
c
.
name
));
}
else
{
tstrncpy
(
c
.
name
,
pSchema
->
name
,
tListLen
(
c
.
name
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录