MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:August 18 2010 9:27am
Subject:Re: bzr commit into mysql-5.5-bugfixing branch (alik:3167) Bug#55847
View as plain text  
* Alexander Nozdrin <alik@stripped> [10/08/09 21:35]:
> === modified file 'sql/sql_show.cc'
> --- a/sql/sql_show.cc	2010-07-29 12:32:11 +0000
> +++ b/sql/sql_show.cc	2010-08-09 17:00:37 +0000
> @@ -109,6 +109,39 @@ append_algorithm(TABLE_LIST *table, Stri
>  
>  static COND * make_cond_for_info_schema(COND *cond, TABLE_LIST *table);
>  
> +///////////////////////////////////////////////////////////////////////////
> +
> +class No_such_table_error_handler : public Internal_error_handler
> +{
> +public:
> +  No_such_table_error_handler() :
> +    m_error_caught(FALSE)
> +  { }
> +
> +public:
> +  inline bool error_caught() const
> +  { return m_error_caught; }
> +
> +public:
> +  bool handle_condition(THD *thd,
> +                        uint sql_errno,
> +                        const char* sqlstate,
> +                        MYSQL_ERROR::enum_warning_level level,
> +                        const char* msg,
> +                        MYSQL_ERROR ** cond_hdl)
> +  {
> +    if (sql_errno == ER_NO_SUCH_TABLE)
> +      m_error_caught= TRUE;
> +
> +    return m_error_caught;
> +  }
> +
> +private:
> +  bool m_error_caught;
> +};

there is already such handler in sql_base.cc, maybe move it
in sql_base.h?

> +///////////////////////////////////////////////////////////////////////////
> +
>  /***************************************************************************
>  ** List all table types supported
>  ***************************************************************************/
> @@ -3320,8 +3353,17 @@ static int fill_schema_table_from_frm(TH
>    key_length= create_table_def_key(thd, key, &table_list, 0);
>    hash_value= my_calc_hash(&table_def_cache, (uchar*) key, key_length);
>    mysql_mutex_lock(&LOCK_open);
> -  share= get_table_share(thd, &table_list, key,
> -                         key_length, OPEN_VIEW, &not_used, hash_value);
> +
> +  {
> +    No_such_table_error_handler err_handler;
> +    thd->push_internal_handler(&err_handler);
> +
> +    share= get_table_share(thd, &table_list, key,
> +                           key_length, OPEN_VIEW, &not_used, hash_value);
> +
> +    thd->pop_internal_handler();
> +  }
> +
>    if (!share)
>    {
>      res= 0;
> @@ -3541,7 +3583,6 @@ int get_all_tables(THD *thd, TABLE_LIST 
>          acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str,
> 0))
>  #endif
>      {
> -      thd->no_warnings_for_error= 1;
>        List<LEX_STRING> table_names;
>        int res= make_table_name_list(thd, &table_names, lex,
>                                      &lookup_field_vals,
> @@ -6617,7 +6658,6 @@ bool get_schema_tables_result(JOIN *join
>    bool result= 0;
>    DBUG_ENTER("get_schema_tables_result");
>  
> -  thd->no_warnings_for_error= 1;

I don't understand what the patch does.
How did the old code work? Why did it have to suppress the
warnings?  How does it work now? Why do you have to suppress
the error?
Please explain in changeset comments.

>    for (JOIN_TAB *tab= join->join_tab; tab < tmp_join_tab; tab++)
>    {  
>      if (!tab->table || !tab->table->pos_in_table_list)
> 

-- 
Thread
bzr commit into mysql-5.5-bugfixing branch (alik:3167) Bug#55847Alexander Nozdrin9 Aug
  • Re: bzr commit into mysql-5.5-bugfixing branch (alik:3167) Bug#55847Konstantin Osipov18 Aug