Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-1953

mysql roller_permission insert statements not defined correctly in 400-to-500-migration.vm and 400-to-500-migration.sql file

    XMLWordPrintableJSON

Details

    Description

      Here select statement is a combination of w.id and w.username whereas the column where it has to insert is roller_permission's id column that doesn't have enough length to fit in.

      concat function is incorrectly used here according to me and if i just use select w.id , upgrade works for me

      insert into roller_permission (id,username,actions,objectid,objecttype,pending,datecreated)
      select concat(w.id, u.username) , u.username, 'edit_draft', w.handle, 'Weblog', 0, current_timestamp
      from rolleruser as u, website as w, roller_user_permissions as p
      where p.user_id = u.id and p.website_id = w.id and permission_mask = 1;

      insert into roller_permission (id,username,actions,objectid,objecttype,pending,datecreated)
      select concat(w.id, u.username) , u.username, 'author', w.handle, 'Weblog', 0, current_timestamp
      from rolleruser as u, website as w, roller_user_permissions as p
      where p.user_id = u.id and p.website_id = w.id and permission_mask = 2;

      insert into roller_permission (id,username,actions,objectid,objecttype,pending,datecreated)
      select concat(w.id, u.username) , u.username, 'admin', w.handle, 'Weblog', 0, current_timestamp
      from rolleruser as u, website as w, roller_user_permissions as p
      where p.user_id = u.id and p.website_id = w.id and permission_mask = 3;

      Attachments

        Activity

          People

            roller_unassigned Roller Unassigned
            harsh.gupta1@gmail.com Harsh Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: