-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(meta): check db's seq after create/drop/rename table #5637
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Thanks for the contribution! Please review the labels and make any necessary changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Please try to minimize the lines of code.
let get_db_req = GetDatabaseReq { | ||
inner: DatabaseNameIdent { | ||
tenant: tenant.to_string(), | ||
db_name: db_name.to_string(), | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider creating a function for building a GetDatabaseReq
, to reduce lines of codes.
Something like fn reg_get_db(tenant: impl ToString, db_name: impl ToString) {...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a new function or macro like:
ASSERT_SEQ_INCR(mt.rename_table(..), tenant1, db1, ...);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a new function or macro like:
ASSERT_SEQ_INCR(mt.rename_table(..), tenant1, db1, ...);
It will encapsulate too many things in one function and make it unclear what it tries to assert.
let tb_ids = { | ||
let old_db = mt.get_database(get_db_req.clone()).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line does not need to be inside this block
Signed-off-by: hezheyu <rinchannow@bupt.edu.cn>
Codes upated. But I'm wondering what is the best place to put |
I do not know either. I find it a difficult task to organize methods and files too. In this case, putting the util functions at bottom of this file would be OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Signed-off-by: RinChanNOWWW hzy427@gmail.com
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
Check db's seq after create/drop/rename table, requiring the db's seq before changing is lower than the new one after changing.
Changelog
Related Issues
Fixes #5220