• Alexander Nozdrin's avatar
    Fix for Bug#13001491: MYSQL_REFRESH CRASHES WHEN STORED ROUTINES ARE RUN CONCURRENTLY. · 1922d65f
    Alexander Nozdrin authored
    The main problem was that lex_start() was forgotten to be called before processing
    COM_REFRESH.
    
    Another problem discovered was that if failures to flush the error log were not properly
    handled, which resulted in the server crash.
    
    The user-visible effect of these problems were:
      - if COM_REFRESH command was sent after SQL-queries of some sort,
        the server would crash.
      - if COM_REFRESH was requested with REFRESH_LOG only, and the error log
        failed to flush, the server would crash. The error log fails to flush
        when it points to unavailable file (for example, due to restricted
        permissions).
    
    The fixes are:
      - call lex_start() in the beginning of COM_REFRESH;
      - handle failures to flush the error log properly, i.e. raise ER_UNKNOWN_ERROR.
    
    sql/sql_parse.cc:
      Fix for Bug#13001491: MYSQL_REFRESH CRASHES WHEN STORED ROUTINES ARE RUN CONCURRENTLY.
    tests/mysql_client_test.c:
      A test case for Bug#13001491: MYSQL_REFRESH CRASHES WHEN STORED ROUTINES
      ARE RUN CONCURRENTLY.
    1922d65f
sql_parse.cc 238 KB