List:Commits« Previous MessageNext Message »
From:Rafal Somla Date:February 6 2008 10:11am
Subject:Re: bk commit into 6.0 tree (cbell:1.2763) BUG#33562
View as plain text  
Chuck,

Two small things before this can be pushed - see below.

cbell@stripped wrote:
> Below is the list of changes that have just been committed into a local
> 6.0 repository of cbell. When cbell does a push these changes will
> be propagated to the main repository and, within 24 hours after the
> push, to the public repository.
> For information on how to access the public repository
> see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
> 
> ChangeSet@stripped, 2008-02-05 11:43:48-05:00, cbell@mysql_cab_desk. +4 -0
>   BUG#33562 : Backup: no warning about disabled storage engine
>     
>   Added calls to save messages so that the SHOW ERRORS and
>   SHOW WARNINGS commands will present the errors and
>   warnings to the client properly.
> 
>   sql/backup/error.h@stripped, 2008-02-05 11:43:39-05:00, cbell@mysql_cab_desk. +9 -3
>     BUG#33562 : Backup: no warning about disabled storage engine
>     
>     Added call to reset no_warnings_for_error to avoid duplicate
>     error messages.
> 
>   sql/backup/kernel.cc@stripped, 2008-02-05 11:43:40-05:00, cbell@mysql_cab_desk. +2 -0
>     BUG#33562 : Backup: no warning about disabled storage engine
>     
>     Added call to reset messages when backup or restore starts.
> 
>   sql/backup/logger.cc@stripped, 2008-02-05 11:43:40-05:00, cbell@mysql_cab_desk. +4 -0
>     BUG#33562 : Backup: no warning about disabled storage engine
>             
>     Added calls to save messages so that the SHOW ERRORS and
>     SHOW WARNINGS commands will present the errors and
>     warnings to the client properly.
> 
>   sql/sql_show.cc@stripped, 2008-02-05 11:43:38-05:00, cbell@mysql_cab_desk. +1 -0
>     BUG#33562 : Backup: no warning about disabled storage engine
>     
>     Added missing call to reset no_warnings_for_error to FALSE.
> 
> diff -Nrup a/sql/backup/error.h b/sql/backup/error.h
> --- a/sql/backup/error.h	2007-11-06 13:32:15 -05:00
> +++ b/sql/backup/error.h	2008-02-05 11:43:39 -05:00
> @@ -11,7 +11,7 @@ namespace util {
>    @returns 0 if error was reported, non-zero otherwise.
>   */
>  inline
> -int report_mysql_error(THD*, MYSQL_ERROR *err, int code= 0)
> +int report_mysql_error(THD* thd, MYSQL_ERROR *err, int code= 0)
>  {
>    DBUG_ASSERT(err);
>  
> @@ -22,8 +22,14 @@ int report_mysql_error(THD*, MYSQL_ERROR
>    switch (err->level) {
>  
>    case MYSQL_ERROR::WARN_LEVEL_ERROR:
> -    return my_printf_error(err->code ? err->code : code, err->msg,
> MYF(0));
> -
> +  {
> +    int ret;
> +    bool old_value= thd->no_warnings_for_error;
> +    thd->no_warnings_for_error= TRUE;
> +    ret= my_printf_error(err->code ? err->code : code, err->msg, MYF(0));
> +    thd->no_warnings_for_error= old_value;
> +    return ret;
> +  }
>    default: // Q: What to do with warnings and notes? push them... ?
>      return -1;
>    }
> diff -Nrup a/sql/backup/kernel.cc b/sql/backup/kernel.cc
> --- a/sql/backup/kernel.cc	2008-01-31 12:26:20 -05:00
> +++ b/sql/backup/kernel.cc	2008-02-05 11:43:40 -05:00
> @@ -91,6 +91,8 @@ execute_backup_command(THD *thd, LEX *le
>  
>    using namespace backup;
>  
> +  mysql_reset_errors(thd, 0);
> +

Also, set thd->no_warnings_for_error to FALSE (so that errors are pushed on the 
stack).

>    /*
>      Check access for SUPER rights. If user does not have SUPER, fail with error.
>    */
> diff -Nrup a/sql/backup/logger.cc b/sql/backup/logger.cc
> --- a/sql/backup/logger.cc	2007-12-13 09:08:42 -05:00
> +++ b/sql/backup/logger.cc	2008-02-05 11:43:40 -05:00
> @@ -33,11 +33,15 @@ int Logger::write_message(log_level::val
>         errors.push_front(new MYSQL_ERROR(::current_thd,error_code,
>                                           MYSQL_ERROR::WARN_LEVEL_ERROR,msg));
>       sql_print_error(buf);
> +     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
> +                         error_code, msg);
>       DBUG_PRINT("backup_log",("[ERROR] %s",buf));
>       return 0;
>  
>     case log_level::WARNING:
>       sql_print_warning(buf);
> +     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
> +                         error_code, msg);
>       DBUG_PRINT("backup_log",("[Warning] %s",buf));
>       return 0;
>  
> diff -Nrup a/sql/sql_show.cc b/sql/sql_show.cc
> --- a/sql/sql_show.cc	2008-01-14 14:49:06 -05:00
> +++ b/sql/sql_show.cc	2008-02-05 11:43:38 -05:00
> @@ -3425,6 +3425,7 @@ err:
>    lex->all_selects_list= old_all_select_lex;
>    lex->view_prepare_mode= save_view_prepare_mode;
>    lex->sql_command= save_sql_command;
> +  thd->no_warnings_for_error= 0;

Instead of setting it to 0, restore the original setting.

>    DBUG_RETURN(error);
>  }
>  
> 
> 

Rafal
Thread
bk commit into 6.0 tree (cbell:1.2763) BUG#33562cbell5 Feb
  • Re: bk commit into 6.0 tree (cbell:1.2763) BUG#33562Rafal Somla6 Feb
    • RE: bk commit into 6.0 tree (cbell:1.2763) BUG#33562Chuck Bell6 Feb