Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
10807abb
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
10807abb
编写于
6月 02, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:fix error in get db name for schemaless parameters
上级
f160e08f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
12 deletion
+16
-12
source/libs/parser/inc/parInt.h
source/libs/parser/inc/parInt.h
+1
-1
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+2
-2
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+13
-9
未找到文件。
source/libs/parser/inc/parInt.h
浏览文件 @
10807abb
...
...
@@ -32,7 +32,7 @@ int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery);
int32_t
translate
(
SParseContext
*
pParseCxt
,
SQuery
*
pQuery
);
int32_t
extractResultSchema
(
const
SNode
*
pRoot
,
int32_t
*
numOfCols
,
SSchema
**
pSchema
);
int32_t
calculateConstant
(
SParseContext
*
pParseCxt
,
SQuery
*
pQuery
);
int32_t
isNotSchemalessDb
(
SParseContext
*
pContext
);
int32_t
isNotSchemalessDb
(
SParseContext
*
pContext
,
char
*
dbName
);
#ifdef __cplusplus
}
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
10807abb
...
...
@@ -1404,9 +1404,9 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
return
buildOutput
(
pCxt
);
}
int32_t
isNotSchemalessDb
(
SParseContext
*
pContext
){
int32_t
isNotSchemalessDb
(
SParseContext
*
pContext
,
char
*
dbName
){
SName
name
;
tNameSetDbName
(
&
name
,
pContext
->
acctId
,
pContext
->
db
,
strlen
(
pContext
->
db
));
tNameSetDbName
(
&
name
,
pContext
->
acctId
,
dbName
,
strlen
(
dbName
));
char
dbFname
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
tNameGetFullDbName
(
&
name
,
dbFname
);
SDbCfgInfo
pInfo
=
{
0
};
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
10807abb
...
...
@@ -2648,8 +2648,8 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt
code
=
checkTableSchema
(
pCxt
,
pStmt
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
pCxt
->
pParseCxt
->
schemalessType
==
0
&&
isNotSchemalessDb
(
pCxt
->
pParseCxt
)
!=
TSDB_CODE_SUCCESS
){
code
=
TSDB_CODE_SML_INVALID_DB_CONF
;
if
(
pCxt
->
pParseCxt
->
schemalessType
==
0
){
code
=
isNotSchemalessDb
(
pCxt
->
pParseCxt
,
pStmt
->
dbName
)
;
}
}
return
code
;
...
...
@@ -4430,9 +4430,7 @@ static SArray* serializeVgroupsCreateTableBatch(int32_t acctId, SHashObj* pVgrou
}
static
int32_t
rewriteCreateMultiTable
(
STranslateContext
*
pCxt
,
SQuery
*
pQuery
)
{
if
(
pCxt
->
pParseCxt
->
schemalessType
==
0
&&
isNotSchemalessDb
(
pCxt
->
pParseCxt
)
!=
TSDB_CODE_SUCCESS
){
return
TSDB_CODE_SML_INVALID_DB_CONF
;
}
SCreateMultiTableStmt
*
pStmt
=
(
SCreateMultiTableStmt
*
)
pQuery
->
pRoot
;
SHashObj
*
pVgroupHashmap
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_NO_LOCK
);
...
...
@@ -4443,6 +4441,10 @@ static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery)
int32_t
code
=
TSDB_CODE_SUCCESS
;
SNode
*
pNode
;
FOREACH
(
pNode
,
pStmt
->
pSubTables
)
{
if
(
pCxt
->
pParseCxt
->
schemalessType
==
0
&&
(
code
=
isNotSchemalessDb
(
pCxt
->
pParseCxt
,
((
SCreateSubTableClause
*
)
pNode
)
->
dbName
))
!=
TSDB_CODE_SUCCESS
){
return
code
;
}
code
=
rewriteCreateSubTable
(
pCxt
,
(
SCreateSubTableClause
*
)
pNode
,
pVgroupHashmap
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
taosHashCleanup
(
pVgroupHashmap
);
...
...
@@ -4853,13 +4855,15 @@ static int32_t buildModifyVnodeArray(STranslateContext* pCxt, SAlterTableStmt* p
}
static
int32_t
rewriteAlterTable
(
STranslateContext
*
pCxt
,
SQuery
*
pQuery
)
{
if
(
pCxt
->
pParseCxt
->
schemalessType
==
0
&&
isNotSchemalessDb
(
pCxt
->
pParseCxt
)
!=
TSDB_CODE_SUCCESS
){
return
TSDB_CODE_SML_INVALID_DB_CONF
;
}
SAlterTableStmt
*
pStmt
=
(
SAlterTableStmt
*
)
pQuery
->
pRoot
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
if
(
pCxt
->
pParseCxt
->
schemalessType
==
0
&&
(
code
=
isNotSchemalessDb
(
pCxt
->
pParseCxt
,
pStmt
->
dbName
))
!=
TSDB_CODE_SUCCESS
){
return
code
;
}
STableMeta
*
pTableMeta
=
NULL
;
int32_t
code
=
getTableMeta
(
pCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
pTableMeta
);
code
=
getTableMeta
(
pCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
pTableMeta
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录