• unknown's avatar
    Fix for bug #29131: SHOW VARIABLES reports variable 'log' but SET · a6457ad2
    unknown authored
    doesn't recognize it
      
    This is a 5.1 version of the patch.
      
    Problem:
      
    'log' and 'log_slow_queries' were "fixed" variables, i.e. they showed up
    in SHOW VARIABLES, but could not be used in expressions like 
    "select @@log". Also, using them in the SET statement produced an 
    incorrect "unknown system variable" error.
      
    Solution:
    
    Since as of MySQL 5.1.12 one can enable or disable the general query log
    or the slow query log at runtime by changing values of
    general_log/slow_query_log, make 'log' and 'log_slow_queries" to be 
    synonyms for 'general_log' and 'slow_query_log' respectively.  This 
    makes expressions using the '@@var' syntax backward compatible with 
    5.0 and SHOW VARIABLES output to be consistent with the SET statement.
    
    
    mysql-test/r/log_state.result:
      Added a test case for bug #29131.
    mysql-test/t/log_state.test:
      Added a test case for bug #29131.
    sql/set_var.cc:
      Made the 'log' and 'log_slow_queries' system variables to be synonyms for 'general_log' and 'slow_query_log'.
    a6457ad2
log_state.test 6.22 KB