Skip to content
  • Tor Didriksen's avatar
    aec5a70e
    Bug#21908206 MEMORY LEAK ON WINDOWS WHEN SELECT FROM VIEW IN SUBQUERY · aec5a70e
    Tor Didriksen authored
    Problem: memory leaks on windows when querying views.
    The problem was the local 'view_lex' in mysql_make_view() which is
    allocated in a MEM_ROOT, and never destroyed
    (it is used later, and cannot be destroyed)
    
    Regression source is patch for:
    Bug#13901905 - CRASH: INSERT ON DUPLICATE KEY UPDATE READS FREED MEMORY
    
    Fix:
    Make LEX::insert_update_values_map private, with accessor functions.
    Make it a pointer, and initialize the std::map on demand, rather than
    up-front (it is used in only rare cases anyways).
    Clear and delete it in lex_end()
    
    Also fix broken build on windows with -DWITH_MSCRT_DEBUG=1
     - rename Path::getcwd() to Path::path_getcwd()
     - remove Protocol_local::free(), it was unused
    aec5a70e
    Bug#21908206 MEMORY LEAK ON WINDOWS WHEN SELECT FROM VIEW IN SUBQUERY
    Tor Didriksen authored
    Problem: memory leaks on windows when querying views.
    The problem was the local 'view_lex' in mysql_make_view() which is
    allocated in a MEM_ROOT, and never destroyed
    (it is used later, and cannot be destroyed)
    
    Regression source is patch for:
    Bug#13901905 - CRASH: INSERT ON DUPLICATE KEY UPDATE READS FREED MEMORY
    
    Fix:
    Make LEX::insert_update_values_map private, with accessor functions.
    Make it a pointer, and initialize the std::map on demand, rather than
    up-front (it is used in only rare cases anyways).
    Clear and delete it in lex_end()
    
    Also fix broken build on windows with -DWITH_MSCRT_DEBUG=1
     - rename Path::getcwd() to Path::path_getcwd()
     - remove Protocol_local::free(), it was unused
Loading