-
Notifications
You must be signed in to change notification settings - Fork 126
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
[CBRD-24929] Add identifier comparator class and refactor comparision of catalog names #4563
Conversation
…ifiers and support functions according to the CUBRID's definition
src/object/schema_system_catalog.cpp
Outdated
|
||
bool sm_check_system_class_by_name (const std::string &name) | ||
{ | ||
return cubschema::sm_catalog_names.is_exists (name); |
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.
The system class name can't be contained dot(.).
So, before execute sm_catalog_names.is_exists(), how about checking if there is "." and returning false if there is ?
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.
Thank you for the review. In CUBRID's identifier writing rule, "." is not allowed in both cases whether a name is enclosed (by quotes) or not.
- I've added a new static function,
check_identifier_is_valid
, which checks name is a valid identifier according to the name enclosed. (40c3c1e) - In
check_identifier_condition()
in identifier_store, changed to usecheck_identifier_is_valid()
above. - I don't think the function check_identifier_is_valid() is in right place. We need to implement a unified identifier writing rule checker needs somewhere. Before then, I'm going to leave it here.
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.
OK, good !!
@hgryoo |
System table names, such as _db_class, _db_attribute, do not follow the identifier's writing rules. Because of the checking identifier's validation, createdb failed in CI because of added logic at 40c3c1e. |
…actor trivial string -> string_view
… of catalog names (#4563) http://jira.cubrid.org/browse/CBRD-24929 Add a class to provide a unified routine to compare identifiers. - string_utility.hpp: For C++ STL's string comparison, lowercase_hash and lowercase_compare structs are added, string_set_ci_lower is defined - identifier_store.hpp: the constructor gets a set of identifier lists and provides is_exists () API. Refactor comparison routine related to system catalog names - schema_system_catalog.[cpp|hpp]: Use the new API of identifier_store for system catalogs - remove legacy duplicated routine (util_common.c, utility.h, load_server_loader.cpp...)
http://jira.cubrid.org/browse/CBRD-24929