Skip to content
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-25356] rename att_name in db_serial to attr_name #5346

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
8 changes: 4 additions & 4 deletions src/executables/unload_schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,12 @@ export_serial (extract_context & ctxt, print_output & output_ctx)
const char *query_all =
"select [unique_name], [name], [owner].[name], " "[current_val], " "[increment_val], " "[max_val], " "[min_val], "
"[cyclic], " "[started], " "[cached_num], " "[comment] "
"from [db_serial] where [class_name] is null and [att_name] is null";
"from [db_serial] where [class_name] is null and [attr_name] is null";

const char *query_user =
"select [unique_name], [name], [owner].[name], " "[current_val], " "[increment_val], " "[max_val], " "[min_val], "
"[cyclic], " "[started], " "[cached_num], " "[comment] "
"from [db_serial] where [class_name] is null and [att_name] is null and owner.name='%s'";
"from [db_serial] where [class_name] is null and [attr_name] is null and owner.name='%s'";

if (ctxt.is_dba_user == false && ctxt.is_dba_group_member == false)
{
Expand Down Expand Up @@ -904,12 +904,12 @@ emit_class_alter_serial (extract_context & ctxt, print_output & output_ctx)
const char *query_all =
"select [unique_name], [name], [owner].[name], [current_val], [increment_val], [max_val], [min_val], "
"[cyclic], [started], [cached_num], [class_name], [comment] "
"from [db_serial] where [class_name] is not null and [att_name] is not null";
"from [db_serial] where [class_name] is not null and [attr_name] is not null";

const char *query_user =
"select [unique_name], [name], [owner].[name], [class_name], [current_val], [increment_val], [max_val], [min_val], "
"[cyclic], [started], [cached_num], [class_name], [comment] "
"from [db_serial] where [class_name] is not null and [att_name] is not null and owner.name='%s'";
"from [db_serial] where [class_name] is not null and [attr_name] is not null and owner.name='%s'";

if (ctxt.is_dba_user == false && ctxt.is_dba_group_member == false)
{
Expand Down
2 changes: 1 addition & 1 deletion src/object/authenticate_owner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_chang
if (!by_class_owner_change)
{
/* It can be checked as one of unique_name, class_name, and att_name. */
error = obj_get (serial_mop, SERIAL_ATTR_ATT_NAME, &value);
error = obj_get (serial_mop, SERIAL_ATTR_ATTR_NAME, &value);
if (error != NO_ERROR)
{
ASSERT_ERROR ();
Expand Down
2 changes: 1 addition & 1 deletion src/object/schema_system_catalog_install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ namespace cubschema
}
},
{"class_name", "string"},
{"att_name", "string"},
{"attr_name", "string"},
{attribute_kind::CLASS_METHOD, "change_serial_owner", "au_change_serial_owner_method"},
{
"cached_num", "integer", [] (DB_VALUE* val)
Expand Down
6 changes: 3 additions & 3 deletions src/parser/parser_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -5975,7 +5975,7 @@ pt_make_collation_expr_node (PARSER_CONTEXT * parser)
*
* IF( (SELECT count(*)
* FROM db_serial S
* WHERE S.att_name = A.attr_name AND
* WHERE S.attr_name = A.attr_name AND
* S.class_name = C.class_name
* ) >= 1 ,
* 'auto_increment',
Expand Down Expand Up @@ -6004,8 +6004,8 @@ pt_make_field_extra_expr_node (PARSER_CONTEXT * parser)

from_item = pt_add_table_name_to_from_list (parser, query, "db_serial", "S", DB_AUTH_NONE);

/* S.att_name = A.attr_name */
where_item1 = pt_make_pred_with_identifiers (parser, PT_EQ, "S.att_name", "A.attr_name");
/* S.attr_name = A.attr_name */
where_item1 = pt_make_pred_with_identifiers (parser, PT_EQ, "S.attr_name", "A.attr_name");
/* S.class_name = C.class_name */
where_item2 = pt_make_pred_with_identifiers (parser, PT_EQ, "S.class_name", "C.class_name");

Expand Down
4 changes: 2 additions & 2 deletions src/query/execute_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ do_create_serial_internal (MOP * serial_object, const char *serial_name, DB_VALU
if (att_name)
{
db_make_string (&value, att_name);
error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_ATT_NAME, &value);
error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_ATTR_NAME, &value);
pr_clear_value (&value);
if (error != NO_ERROR)
{
Expand Down Expand Up @@ -948,7 +948,7 @@ do_update_auto_increment_serial_on_rename (MOP serial_obj, const char *class_nam

/* att name */
db_make_string (&value, att_name);
error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_ATT_NAME, &value);
error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_ATTR_NAME, &value);
pr_clear_value (&value);
if (error != NO_ERROR)
{
Expand Down
6 changes: 3 additions & 3 deletions src/query/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ typedef enum
SERIAL_ATTR_CYCLIC_INDEX,
SERIAL_ATTR_STARTED_INDEX,
SERIAL_ATTR_CLASS_NAME_INDEX,
SERIAL_ATTR_ATT_NAME_INDEX,
SERIAL_ATTR_ATTR_NAME_INDEX,
SERIAL_ATTR_CACHED_NUM_INDEX,
SERIAL_ATTR_MAX_INDEX
} SR_ATTRIBUTES;
Expand Down Expand Up @@ -1301,9 +1301,9 @@ serial_load_attribute_info_of_db_serial (THREAD_ENTRY * thread_p)
{
serial_Attrs_id[SERIAL_ATTR_CLASS_NAME_INDEX] = i;
}
else if (strcmp (attr_name_p, SERIAL_ATTR_ATT_NAME) == 0)
else if (strcmp (attr_name_p, SERIAL_ATTR_ATTR_NAME) == 0)
{
serial_Attrs_id[SERIAL_ATTR_ATT_NAME_INDEX] = i;
serial_Attrs_id[SERIAL_ATTR_ATTR_NAME_INDEX] = i;
}
else if (strcmp (attr_name_p, SERIAL_ATTR_CACHED_NUM) == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/storage/storage_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ typedef enum
#define SERIAL_ATTR_CYCLIC "cyclic"
#define SERIAL_ATTR_STARTED "started"
#define SERIAL_ATTR_CLASS_NAME "class_name"
#define SERIAL_ATTR_ATT_NAME "att_name"
#define SERIAL_ATTR_ATTR_NAME "attr_name"
#define SERIAL_ATTR_CACHED_NUM "cached_num"
#define SERIAL_ATTR_COMMENT "comment"

Expand Down
Loading