• unknown's avatar
    BUG#34789 - drop server/create server leaks memory ! · b31a1622
    unknown authored
    When CREATE SERVER is issued, it allocates memory on memory root
    to store cached server structure. When DROP SERVER is issued,
    it doesn't release this memory, as it is impossible with the
    memory root.
    
    We use the same allocation strategy for plugins and acl. The problem
    here that there was no way (except for the server restart) to force
    'servers' code to release this memory.
    
    With this fix it is possible to release unused server cache memory
    by FLUSH PRIVILEGES.
    
    No test case for this fix.
    
    
    sql/sql_parse.cc:
      Reload servers table on FLUSH PRIVILEGES.
    sql/sql_servers.cc:
      Instead of just marking memory blocks as unused, release memory
      used by servers cache and initialize new memory root.
      
      This is needed for FLUSH PRIVILEGES to release unused memory
      blocks.
    b31a1622
sql_parse.cc 220 KB