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-24564] reflect reuse-oid option in error message prining at view updating query. #3959

Merged
merged 9 commits into from
Nov 27, 2022

Conversation

beyondykk9
Copy link
Contributor

http://jira.cubrid.org/browse/CBRD-24564

The updating query with a view can be faced with error when the included table in the view has reuse-oid option. However, the error message does not reflect the option as the below message.

AS-IS:

create table t1(c1 int);
create view v3 as select c1 from t1;

insert into v3(c1) values (1);
ERROR: Vclass dba.v3 is not updatable.

TO-BE:
ERROR: Vclass dba.v3 is not updatable, because dba.t1 is reuse_oid table.

@beyondykk9 beyondykk9 added this to the fig milestone Nov 18, 2022
@beyondykk9 beyondykk9 self-assigned this Nov 18, 2022
@hgryoo
Copy link
Member

hgryoo commented Nov 21, 2022

Is there any case where the MSGCAT_RUNTIME_VCLASS_NOT_UPDATABE error occurs and is unrelated to the reuse_oid table?

@youngjinj
Copy link
Contributor

youngjinj commented Nov 22, 2022

In addition to msg/en_US/cubrid.msg, other message files must also be changed.

And even if there is more than one reuse_oid table, only one table name is printed in the error message.

drop table if exists t1, t2;
create table t1 (c1 int, c2 int);
create table t2 (c1 int, c2 int);
insert into t1 values (1, 1), (2, 2), (3, 3);
insert into t2 values (1, 10), (2, 20), (3, 30);
create or replace view v1 as
  select t1.c1 as c1, t1.c2 as t1_c2, t2.c2 as t2_c2
  from t1, t2
  where t1.c1 = t2.c1;
update v1 set t1_c2 = t1_c2 * 10, t2_c2 = t2_c2 * 10;
ERROR: Vclass dba.v1 is not updatable, because dba.t1 table is REUSE_OID..

I think the purpose of this change is to make the meaning clear to users.
However, it is not clear to tell reuse_oid for only one table.

In addition, the code becomes complicated by continuously passing unnecessary arguments only for error message output.

The reason why users cannot clearly understand the error message is that they do not understand reuse_oid.
I think it's better to add a message like the one below rather than mentioning individual tables.

ERROR: Vclass dba.v1 is not updatable, Vclass referencing class that are reuse_oid cannot be updated.

@beyondykk9
Copy link
Contributor Author

beyondykk9 commented Nov 23, 2022

In addition to msg/en_US/cubrid.msg, other message files must also be changed.

And even if there is more than one reuse_oid table, only one table name is printed in the error message.

drop table if exists t1, t2;
create table t1 (c1 int, c2 int);
create table t2 (c1 int, c2 int);
insert into t1 values (1, 1), (2, 2), (3, 3);
insert into t2 values (1, 10), (2, 20), (3, 30);
create or replace view v1 as
  select t1.c1 as c1, t1.c2 as t1_c2, t2.c2 as t2_c2
  from t1, t2
  where t1.c1 = t2.c1;
update v1 set t1_c2 = t1_c2 * 10, t2_c2 = t2_c2 * 10;
ERROR: Vclass dba.v1 is not updatable, because dba.t1 table is REUSE_OID..

I think the purpose of this change is to make the meaning clear to users. However, it is not clear to tell reuse_oid for only one table.

In addition, the code becomes complicated by continuously passing unnecessary arguments only for error message output.

The reason why users cannot clearly understand the error message is that they do not understand reuse_oid. I think it's better to add a message like the one below rather than mentioning individual tables.

ERROR: Vclass dba.v1 is not updatable, Vclass referencing class that are reuse_oid cannot be updated.

The message is made from discussion enough of the issue. The reuse_oid table related to the view is minimal information for showing the reason of the fail.

And the error messages will be added as multilingual version.

@beyondykk9
Copy link
Contributor Author

Is there any case where the MSGCAT_RUNTIME_VCLASS_NOT_UPDATABE error occurs and is unrelated to the reuse_oid table?

The unauthorized table which is not granted (SELECT ONLY) from the user is not updatable.

@hgryoo
Copy link
Member

hgryoo commented Nov 23, 2022

Is there any case where the MSGCAT_RUNTIME_VCLASS_NOT_UPDATABE error occurs and is unrelated to the reuse_oid table?

The unauthorized table which is not granted (SELECT ONLY) from the user is not updatable.

If the same error code is specified for multiple cases, IMO, the same detailed level of error message should be displayed.

@beyondykk9 beyondykk9 merged commit 590885a into CUBRID:develop Nov 27, 2022
@beyondykk9 beyondykk9 deleted the CBRD-24564 branch November 27, 2022 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants