matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 277 forks source link

[Bug]: the column 'obj_id' of table mo_catalog.mo_pitr is inconsistent after the table is deleted and the table is created. #18970

Closed Ariznawlll closed 1 month ago

Ariznawlll commented 1 month ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

6894dd9338bedf38d2dfbf52a3213f48d6353cb2

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

image

删除表又重新建表后,这个两个值不一样了:

image

Expected Behavior

No response

Steps to Reproduce

1. 
create database test01;
use test01;
drop table t1;
create table t1 (col1 int, col2 decimal);
insert into t1 values (1,2);
create pitr p01 range 1 'h';
2. select rel_id, relname, reldatabase, reldatabase_id from mo_catalog.mo_tables where reldatabase = 'test01';
3. select * from mo_catalog.mo_pitr;
4. 
drop table t1;
create table t1 (col1 int, col2 decimal);
insert into t1 values (1,2);
5. select rel_id, relname, reldatabase, reldatabase_id from mo_catalog.mo_tables where reldatabase = 'test01';
6. select * from mo_catalog.mo_pitr;

步骤2 3对比obj_id与rel_id是一样的,步骤5 6 obj_id与rel_id不一样

Additional information

No response

YANGGMM commented 1 month ago

finished, plz test @Ariznawlll

Ariznawlll commented 1 month ago

testing

Ariznawlll commented 1 month ago

testing

Ariznawlll commented 1 month ago

main commit: 98eb8509a

创建table级别的pitr:

case:
1. create database test01;
use test01;
drop table t1;
create table t1 (col1 int, col2 decimal);
insert into t1 values (1,2);
create pitr p01 for database test01 table t1 range 1 'h';
2. select rel_id, relname, reldatabase, reldatabase_id from mo_catalog.mo_tables where reldatabase = 'test01';
3. select * from mo_catalog.mo_pitr;
4. drop table t1;
create table t1 (col1 int, col2 decimal);
insert into t1 values (1,2);
5. select rel_id, relname, reldatabase, reldatabase_id from mo_catalog.mo_tables where reldatabase = 'test01';
6. select * from mo_catalog.mo_pitr;
image

对比步骤2 3对比obj_id与rel_id相同,步骤5 6 obj_id与rel_id相同,测试通过

Ariznawlll commented 1 month ago

main commit: 98eb8509a

创建db级别的pitr:

case:
1. create database test01;
create pitr p01 for database test01 range 1 'h';
2. select dat_id, datname from mo_catalog.mo_database where datname = 'test01';
3. select * from mo_catalog.mo_pitr;
4. drop database test01;
create database test01;
5. select dat_id, datname from mo_catalog.mo_database where datname = 'test01';
6. select * from mo_catalog.mo_pitr;
image

对比步骤2 3对比obj_id与rel_id相同,步骤5 6 obj_id与rel_id相同,测试通过

Ariznawlll commented 1 month ago

创建account级别的pitr:

case:
1. create account acc01 admin_name = 'test_account' identified by '111';
create pitr p01 for account acc01 range 1 'h';
2. select account_id, account_name from mo_catalog.mo_account where account_name = 'acc01';
3. select * from mo_catalog.mo_pitr;
4. drop account acc01;
create account acc01 admin_name = 'test_account' identified by '111';
5. select account_id, account_name from mo_catalog.mo_account where account_name = 'acc01';
6. select * from mo_catalog.mo_pitr;
image

对比步骤2 3对比obj_id与rel_id相同,步骤5 6 obj_id与rel_id相同,测试通过