1. 07 Feb, 2011 3 commits
    • Dmitry Lenev's avatar
      Merged fix for bug #36544 "DROP USER does not remove stored · 9c25613a
      Dmitry Lenev authored
      function privileges" into 5.5 tree. Did after-merge fixes.
      9c25613a
    • Dmitry Lenev's avatar
      Merged fix for bug #36544 "DROP USER does not remove stored · f74fd118
      Dmitry Lenev authored
      function privileges" into 5.5 tree. Did after-merge fixes.
      f74fd118
    • Dmitry Lenev's avatar
      Fix for bug#36544 "DROP USER does not remove stored function · b169b8d8
      Dmitry Lenev authored
      privileges".
      
      The first problem was that DROP USER didn't properly remove privileges 
      on stored functions from in-memory structures. So the dropped user
      could have called stored functions on which he had privileges before
      being dropped while his connection was still around.
      Even worse if a new user with the same name was created he would
      inherit privileges on stored functions from the dropped user.
      Similar thing happened with old user name and function privileges
      during RENAME USER.
      
      This problem stemmed from the fact that the handle_grant_data() function
      which handled DROP/RENAME USER didn't take any measures to update
      in-memory hash with information about function privileges after
      updating them on disk.
      
      This patch solves this problem by adding code doing just that.
      
      The second problem was that RENAME USER didn't properly update in-memory
      structures describing table-level privileges and privileges on stored 
      procedures. As result such privileges could have been lost after a rename
      (i.e. not associated with the new name of user) and inherited by a new
      user with the same name as the old name of the original user.
      
      This problem was caused by code handling RENAME USER in
      handle_grant_struct() which [sic!]:
      a) tried to update wrong (tables) hash when updating stored procedure
         privileges for new user name.
      b) passed wrong arguments to function performing the hash update and
         didn't take into account the way in which such update could have
         changed the order of the hash elements.
      
      This patch solves this problem by ensuring that a) the correct hash
      is updated, b) correct arguments are used for the hash_update()
      function and c) we take into account possible changes in the order
      of hash elements.
      
      mysql-test/r/grant.result:
        Added test coverage for bug#36544 "DROP USER does not remove stored
        function privileges".
      mysql-test/suite/funcs_1/r/innodb_storedproc_06.result:
        Since after fixing bug#36544 "DROP USER does not remove stored function
        privileges" in-memory structures are correctly updated by DROP USER,
        DROP FUNCTION performed after DROP USER for its definer no longer
        produces unwarranted warning/error messages.
      mysql-test/suite/funcs_1/r/memory_storedproc_06.result:
        Since after fixing bug#36544 "DROP USER does not remove stored function
        privileges" in-memory structures are correctly updated by DROP USER,
        DROP FUNCTION performed after DROP USER for its definer no longer
        produces unwarranted warning/error messages.
      mysql-test/suite/funcs_1/r/myisam_storedproc_06.result:
        Since after fixing bug#36544 "DROP USER does not remove stored function
        privileges" in-memory structures are correctly updated by DROP USER,
        DROP FUNCTION performed after DROP USER for its definer no longer
        produces unwarranted warning/error messages.
      mysql-test/t/grant.test:
        Added test coverage for bug#36544 "DROP USER does not remove stored
        function privileges".
      sql/sql_acl.cc:
        Changed handle_grant_data() to also update hash with function 
        privileges. This allows DROP/RENAME USER correctly keep this 
        in-memory structure up-to-date.
        
        To do this extended handle_grant_struct() to support updating of this
        hash. In addition fixed code in this function which is responsible for 
        handling of column and routine hashes during RENAME USER, ensured that
        we correctly update these hashes after changing user name and that we
        don't skip elements while iterating through the hash and doing updates.
      b169b8d8
  2. 02 Feb, 2011 1 commit
  3. 28 Jan, 2011 6 commits
  4. 27 Jan, 2011 4 commits
  5. 26 Jan, 2011 12 commits
    • Mattias Jonsson's avatar
      merge of bug 47902 and (null-merge) of bug 57924. · 6ae9810f
      Mattias Jonsson authored
      bug#57924 does not occur in 5.5, so I reverted the 5.1 specific
      code and used the errors from 5.5 instead in the tests
      6ae9810f
    • Mattias Jonsson's avatar
      merge · ec5e43da
      Mattias Jonsson authored
      ec5e43da
    • Mattias Jonsson's avatar
      merge · ad74ed74
      Mattias Jonsson authored
      ad74ed74
    • Jon Olav Hauglid's avatar
      Bug #42230 during add index, cannot do queries on storage engines · e99f2b1c
      Jon Olav Hauglid authored
                 that implement add_index
      
      The problem was that ALTER TABLE blocked reads on an InnoDB table
      while adding a secondary index, even if this was not needed. It is
      only needed for the final step where the .frm file is updated.
      
      The reason queries were blocked, was that ALTER TABLE upgraded the
      metadata lock from MDL_SHARED_NO_WRITE (which blocks writes) to
      MDL_EXCLUSIVE (which blocks all accesses) before index creation.
      
      The way the server handles index creation, is that storage engines
      publish their capabilities to the server and the server determines
      which of the following three ways this can be handled: 1) build a
      new version of the table; 2) change the existing table but with
      exclusive metadata lock; 3) change the existing table but without
      metadata lock upgrade.
      
      For InnoDB and secondary index creation, option 3) should have been
      selected. However this failed for two reasons. First, InnoDB did
      not publish this capability properly.
      
      Second, the ALTER TABLE code failed to made proper use of the
      information supplied by the storage engine. A variable
      need_lock_for_indexes was set accordingly, but was not later used.
      This patch fixes this problem by only doing metadata lock upgrade
      before index creation/deletion if this variable has been set.
      
      This patch also changes some of the related terminology used 
      in the code. Specifically the use of "fast" and "online" with
      respect to ALTER TABLE. "Fast" was used to indicate that an
      ALTER TABLE operation could be done without involving a
      temporary table. "Fast" has been renamed "in-place" to more
      accurately describe the behavior.
      
      "Online" meant that the operation could be done without taking
      a table lock. However, in the current implementation writes
      are always prohibited during ALTER TABLE and an exclusive
      metadata lock is held while updating the .frm, so ALTER TABLE
      is not completely online. This patch replaces "online" with 
      "in-place", with additional comments indicating if concurrent
      reads are allowed during index creation/deletion or not.
      
      An important part of this update of terminology is renaming
      of the handler flags used by handlers to indicate if index
      creation/deletion can be done in-place and if concurrent reads
      are allowed. For example, the HA_ONLINE_ADD_INDEX_NO_WRITES
      flag has been renamed to HA_INPLACE_ADD_INDEX_NO_READ_WRITE,
      while HA_ONLINE_ADD_INDEX is now HA_INPLACE_ADD_INDEX_NO_WRITE.
      Note that this is a rename to clarify current behavior, the
      flag values have not changed and no flags have been removed or
      added.
      
      Test case added to innodb_mysql_sync.test.
      e99f2b1c
    • Ramil Kalimullin's avatar
      Auto-merge · 02b45f2a
      Ramil Kalimullin authored
      02b45f2a
    • Ramil Kalimullin's avatar
    • Ramil Kalimullin's avatar
      Bug #47811 : remove the non-default alignment specification. · 7083cb0b
      Ramil Kalimullin authored
      Fix backported from to 5.0.
      "Remove the alignment option, let valgrind use its default"
      
      
      mysql-test/mysql-test-run-shell.sh:
        Bug #47811 : remove the non-default alignment specification.
          - backport from 5.1
           "Remove the alignment option, let valgrind use its default"
      mysql-test/mysql-test-run.pl:
        Bug #47811 : remove the non-default alignment specification.
          - backport from 5.1
           "Remove the alignment option, let valgrind use its default"
      7083cb0b
    • Alfranio Correia's avatar
      merge mysql-5.1 --> mysql-5.5 · c4bedd13
      Alfranio Correia authored
      c4bedd13
    • Alfranio Correia's avatar
    • Libing Song's avatar
      Auto Merge. · ed1e03f0
      Libing Song authored
      ed1e03f0
    • Libing Song's avatar
      Null Merge. · 83f603b1
      Libing Song authored
      83f603b1
    • Libing Song's avatar
      Postfix bug#49124 · 8ec9bbaf
      Libing Song authored
      Updated the copyright.
      8ec9bbaf
  6. 25 Jan, 2011 6 commits
  7. 24 Jan, 2011 2 commits
  8. 21 Jan, 2011 2 commits
  9. 20 Jan, 2011 1 commit
  10. 19 Jan, 2011 3 commits