Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: fix leak of prepared statements #33529

Commits on Jan 13, 2019

  1. sql: fix leak of prepared statements

    The connExPrepStmtsAccessor.DeleteAll() method was not properly implemented and
    "leaked" the memory accounting for  prepared statements. This could lead
    to crashes, like showed below.
    
    I've looked at the various open issues around memory leak crashes, but
    unfortunately I think it's unlikely this fixes those. Anyway, I'll
    backport.
    
    root@127.0.0.1:53405/defaultdb> begin; select 1;
    root@127.0.0.1:53405/defaultdb  OPEN> prepare x as select 1;
    root@127.0.0.1:53405/defaultdb  OPEN> deallocate all;
    root@127.0.0.1:53405/defaultdb  OPEN> commit;
    root@127.0.0.1:53405/defaultdb> ^D
    panic: session: unexpected 10240 leftover bytes
    
    Release note (bug fix): Fix a memory leak around DEALLOCATE and DISCARD
    statements that could result in crashes with the "unexpected <amount>
    leftover bytes" message.
    andreimatei committed Jan 13, 2019
    Configuration menu
    Copy the full SHA
    05314fa View commit details
    Browse the repository at this point in the history