<commit_before>drop procedure if exists ui_delete_user_roles;
delimiter $$
create procedure ui_delete_user_roles(i_user_id int(10), i_roles_list text)
 main_sql:
  begin
    delete from user_roles
     where user_user_id = i_user_id
           and instr(concat(',', i_roles_list, ','),
                     concat(',', role_role_id, ',')
              ) > 0;

    select 'OK' status, null error_message;
  end
$$
delimiter ;
call save_routine_information('ui_delete_user_roles',
                              concat_ws(',',
                                        'status varchar',
                                        'error_message varchar'
                              )
     );<commit_msg>user role logical error on delete<commit_after>drop procedure if exists ui_delete_user_roles;
delimiter $$
create procedure ui_delete_user_roles(i_user_id int(10), i_roles_list text)
 main_sql:
  begin
    delete from user_roles
     where user_user_id = i_user_id
           and instr(concat(',', i_roles_list, ','),
                     concat(',', role_role_id, ',')
              ) > 0;

    delete ura
      from     user_role_actions ura
             join
               role_actions ra
             on ura.ract_ract_id = ra.ract_id
           left join
             user_roles ur
           on ur.role_role_id = ra.role_role_id
              and ura.user_user_id = ur.user_user_id
     where ura.user_user_id = i_user_id and ur.urol_id is null;

    select 'OK' status, null error_message;
  end
$$
delimiter ;
call save_routine_information('ui_delete_user_roles',
                              concat_ws(',',
                                        'status varchar',
                                        'error_message varchar'
                              )
     );
{'fraction_non_alphanumeric': 0.0771830985915493, 'fraction_numerical': 0.0033802816901408453, 'mean_word_length': 1.6350148367952522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6883486', 'n_tokens_mistral': 522, 'n_tokens_neox': 504, 'n_words': 113}