forked from databendlabs/databend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: purge dropped view metadata during vacuum (databendlabs#16819)
* chore: purge view metadata during vacuum * tweak logic test
- Loading branch information
1 parent
c54c413
commit 909dd9b
Showing
2 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/sqllogictests/suites/ee/03_ee_vacuum/03_0002_vacuum_views.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
## Copyright 2023 Databend Cloud | ||
## | ||
## Licensed under the Elastic License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## https://www.elastic.co/licensing/elastic-license | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
|
||
statement ok | ||
drop database if exists vacuum_view_test; | ||
|
||
statement ok | ||
create database vacuum_view_test; | ||
|
||
statement ok | ||
use vacuum_view_test; | ||
|
||
statement ok | ||
create table t as select * from numbers(1); | ||
|
||
statement ok | ||
create view v as select * from t; | ||
|
||
statement ok | ||
drop view v; | ||
|
||
# the dropped view vacuum_view_test.v should be there | ||
query I | ||
select count() from system.tables_with_history where database = 'vacuum_view_test' and name = 'v'; | ||
---- | ||
1 | ||
|
||
statement ok | ||
set data_retention_time_in_days = 0; | ||
|
||
statement ok | ||
vacuum drop table from vacuum_view_test; | ||
|
||
# the dropped view vacuum_view_test.v should be vacuumed | ||
query I | ||
select count() from system.tables_with_history where database = 'vacuum_view_test' and name = 'v'; | ||
---- | ||
0 | ||
|
||
statement ok | ||
drop database vacuum_view_test; |