为什么 voltdb 在指定 table 上的默认删除和更新程序不起作用
why the default delete and update procedure of voltdb on specified table not work
我使用 voltdb 生成的默认程序来更新以下 table,
schema:
create table sys_sec_user_org_role(
user_id bigint not null,
org_id integer not null,
role_id integer not null,
primary key(user_id,role_id,org_id)
);
partition table sys_sec_user_org_role on column user_id;
然后默认程序创建成功,我按以下顺序调用程序
insert:exec SYS_SEC_USER_ORG_ROLE.insert 2 3 4
sucess:modified_tuples:1
然后删除插入的行
delete:exec SYS_SEC_USER_ORG_ROLE.delete 2 3 4
modified_tuples:0
我不知道为什么默认删除或更新对此不起作用 table 而大多数情况下都有效。
[已更新]
我在 VoltDB 工作。感谢您分享这一点。我得到了与您相同的结果,最初以为这是一个错误,但我们的一位工程师注意到了这个问题。
虽然 .insert 过程按照列在 table 中定义的顺序获取参数,但仅当定义了主键时才会生成 .update 和过程,并且参数需要按照主键中定义的列顺序。
如果您按主键列的顺序传入参数,默认过程将找到匹配的行并更新或删除它。
--exec <tablename>.delete <user_id> <role_id> <org_id>;
exec SYS_SEC_USER_ORG_ROLE.delete 2 4 3;
(Returned 1 rows in 0.02s)
这里是我之前登录的ticket,供参考。
我使用 voltdb 生成的默认程序来更新以下 table,
schema:
create table sys_sec_user_org_role(
user_id bigint not null,
org_id integer not null,
role_id integer not null,
primary key(user_id,role_id,org_id)
);
partition table sys_sec_user_org_role on column user_id;
然后默认程序创建成功,我按以下顺序调用程序
insert:exec SYS_SEC_USER_ORG_ROLE.insert 2 3 4
sucess:modified_tuples:1
然后删除插入的行
delete:exec SYS_SEC_USER_ORG_ROLE.delete 2 3 4
modified_tuples:0
我不知道为什么默认删除或更新对此不起作用 table 而大多数情况下都有效。
[已更新]
我在 VoltDB 工作。感谢您分享这一点。我得到了与您相同的结果,最初以为这是一个错误,但我们的一位工程师注意到了这个问题。
虽然 .insert 过程按照列在 table 中定义的顺序获取参数,但仅当定义了主键时才会生成 .update 和过程,并且参数需要按照主键中定义的列顺序。
如果您按主键列的顺序传入参数,默认过程将找到匹配的行并更新或删除它。
--exec <tablename>.delete <user_id> <role_id> <org_id>;
exec SYS_SEC_USER_ORG_ROLE.delete 2 4 3;
(Returned 1 rows in 0.02s)
这里是我之前登录的ticket,供参考。