• unknown's avatar
    bug #16813 (WITH CHECK OPTION fails with UPDATE) · 5389cc16
    unknown authored
    We use the condition from CHECK OPTION twice handling UPDATE command.
    First we construnct 'update_cond' AND 'option_cond'
    condition to select records to be updated, then we check the
    'option_cond' for the updated row.
    The problem is that first 'AND' condition is optimized during the 'select'
    which can break 'option_cond' structure, so it will be unusable for
    the sectond use - to check the updated row.
    Possible soultion is either use copy of the condition in the first
    use or to make optimization less traumatic for the operands.
    I picked the first one. 
    
    
    mysql-test/r/view.result:
      result fixed
    mysql-test/t/view.test:
      testcase
    sql/table.cc:
      now we use the copy of the CHECK OPTION condition to construct
      the select's condition
    5389cc16
view.test 73.2 KB