static void update_output_type()

in plugin/server_audit/server_audit.cc [2396:2421]


static void update_output_type(MYSQL_THD thd,
              struct SYS_VAR *var  __attribute__((unused)),
              void *var_ptr  __attribute__((unused)), const void *save)
{
  ulong new_output_type= *((const ulong *) save);
  if (output_type == new_output_type)
    return;

  ADD_ATOMIC(internal_stop_logging, 1);
  mysql_prlock_wrlock(&lock_operations);
  if (logging)
  {
    log_current_query(thd);
    stop_logging();
  }

  output_type= new_output_type;
  error_header();
  fprintf(stderr, "Output was redirected to '%s'\n",
          output_type_names[output_type]);

  if (logging)
    start_logging();
  mysql_prlock_unlock(&lock_operations);
  ADD_ATOMIC(internal_stop_logging, -1);
}