• unknown's avatar
    Fix for the following bugs: · 8f395ebb
    unknown authored
      - BUG#15166: Wrong update permissions required to execute triggers
      - BUG#15196: Wrong select permission required to execute triggers
    
    The idea of the fix is to check necessary privileges
    in Item_trigger_field::fix_fields(), instead of having "special variables"
    technique. To achieve this, we should pass to an Item_trigger_field instance
    a flag, which will indicate the usage/access type of this trigger variable.
    
    
    mysql-test/r/trigger-grant.result:
      Update the result file.
    mysql-test/t/trigger-grant.test:
      Add test cases for BUG#15166 and BUG#15196
    sql/item.cc:
      Item_trigger_field: check appropriate (SELECT/UPDATE) privilege in fix_fields().
    sql/item.h:
      Add a flag to specify access type for trigger field.
    sql/sql_trigger.cc:
      "Special variable" technique of checking privileges for NEW/OLD variables
      was replaced by checking table- and column-level privileges in
      Item_trigger_field::fix_fields().
    sql/sql_trigger.h:
      "Special variable" technique of checking privileges for NEW/OLD variables
      was replaced by checking table- and column-level privileges in
      Item_trigger_field::fix_fields().
    sql/sql_yacc.yy:
      Specify access type for trigger fields.
    8f395ebb
trigger-grant.result 10.4 KB