Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7db984bd
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7db984bd
编写于
10月 19, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
10月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17490 from taosdata/fix/TD-19652
rm deleted table idx
上级
308dd565
9805c50b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
120 addition
and
11 deletion
+120
-11
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+34
-11
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+2
-0
tests/script/tsim/tag/drop_tag.sim
tests/script/tsim/tag/drop_tag.sim
+84
-0
未找到文件。
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
7db984bd
...
...
@@ -26,6 +26,7 @@ static int metaUpdateCtbIdx(SMeta *pMeta, const SMetaEntry *pME);
static
int
metaUpdateSuidIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
);
static
int
metaUpdateTagIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pCtbEntry
);
static
int
metaDropTableByUid
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int
*
type
);
static
void
metaDestroyTagIdxKey
(
STagIdxKey
*
pTagIdxKey
);
static
void
metaGetEntryInfo
(
const
SMetaEntry
*
pEntry
,
SMetaInfo
*
pInfo
)
{
pInfo
->
uid
=
pEntry
->
uid
;
...
...
@@ -594,6 +595,28 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) {
const
SSchema
*
pTagColumn
=
&
stbEntry
.
stbEntry
.
schemaTag
.
pSchema
[
0
];
if
(
pTagColumn
->
type
==
TSDB_DATA_TYPE_JSON
)
{
metaDelJsonVarFromIdx
(
pMeta
,
&
e
,
pTagColumn
);
}
else
{
STagIdxKey
*
pTagIdxKey
=
NULL
;
int32_t
nTagIdxKey
;
const
void
*
pTagData
=
NULL
;
int32_t
nTagData
=
0
;
STagVal
tagVal
=
{.
cid
=
pTagColumn
->
colId
};
tTagGet
((
const
STag
*
)
e
.
ctbEntry
.
pTags
,
&
tagVal
);
if
(
IS_VAR_DATA_TYPE
(
pTagColumn
->
type
))
{
pTagData
=
tagVal
.
pData
;
nTagData
=
(
int32_t
)
tagVal
.
nData
;
}
else
{
pTagData
=
&
(
tagVal
.
i64
);
nTagData
=
tDataTypes
[
pTagColumn
->
type
].
bytes
;
}
if
(
metaCreateTagIdxKey
(
e
.
ctbEntry
.
suid
,
pTagColumn
->
colId
,
pTagData
,
nTagData
,
pTagColumn
->
type
,
uid
,
&
pTagIdxKey
,
&
nTagIdxKey
)
==
0
)
{
tdbTbDelete
(
pMeta
->
pTagIdx
,
pTagIdxKey
,
nTagIdxKey
,
&
pMeta
->
txn
);
}
metaDestroyTagIdxKey
(
pTagIdxKey
);
}
tDecoderClear
(
&
tdc
);
}
...
...
tests/script/jenkins/basic.txt
浏览文件 @
7db984bd
...
...
@@ -445,5 +445,7 @@
./test.sh -f tsim/tag/set.sim
./test.sh -f tsim/tag/smallint.sim
./test.sh -f tsim/tag/tinyint.sim
./test.sh -f tsim/tag/drop_tag.sim
#======================b1-end===============
tests/script/tsim/tag/drop_tag.sim
0 → 100644
浏览文件 @
7db984bd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
$dbPrefix = ta_bib_db
$tbPrefix = ta_bib_tb
$mtPrefix = ta_bib_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database if exists $db
sql create database $db vgroups 1
sql use $db
print ======== test bigint
sql create table if not exists st( ts timestamp, order_id bigint) tags (account_id bigint)
sql create table t1 using st tags(111)
sql create table t2 using st tags(222)
sql insert into t1(ts, order_id) values(1648791213001, 1)
sql insert into t2(ts, order_id) values(1648791213002, 2)
sql select account_id,count(*) from st where account_id = 111 group by account_id
sql drop table t1
sql create table t1 using st tags(111)
sql insert into t1(ts, order_id) values(1648791213001, 1)
sql insert into t2(ts, order_id) values(1648791213002, 2)
sql select account_id,count(*) from st where account_id = 111 group by account_id
if $rows != 1 then
return -1
endi
print ======== test varchar
sql drop stable st
sql create table if not exists st( ts timestamp, order_id bigint) tags (account_id binary(16))
sql create table t1 using st tags("aac")
sql create table t2 using st tags("abc")
sql insert into t1(ts, order_id) values(1648791213001, 1)
sql insert into t2(ts, order_id) values(1648791213002, 2)
sql select account_id,count(*) from st where account_id = "aac" group by account_id
sql drop table t1
sql create table t1 using st tags("aac")
sql insert into t1(ts, order_id) values(1648791213001, 1)
sql insert into t2(ts, order_id) values(1648791213002, 2)
sql select account_id,count(*) from st where account_id = "aac" group by account_id
if $rows != 1 then
return -1
endi
print ====== test empty table
sql drop table t1
sql select account_id,count(*) from st where account_id = "aac" group by account_id
if $rows != 0 then
return -1
endi
sql drop database $db
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录