List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:November 12 2007 6:10pm
Subject:Re: bk commit into 5.1 tree (holyfoot:1.2625) BUG#31960
View as plain text  
Hi!

On Nov 08, holyfoot@stripped wrote:
> ChangeSet@stripped, 2007-11-08 10:04:33+04:00, holyfoot@stripped +2 -0
>   Bug #31960 All embedded test crash
>   
>   Crash happens as a result of NO_EMBEDDED_ACCESS_CHECKS option
>   (which is default for embedded server).
>   check_table_access failed on using unintialized structure.
>   Better solutions here is to disable that code completely in this case.
>   Though the crash happens only in 6.0 i belive it's good to do it in 5.1
> 
> diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
> --- a/sql/sql_parse.cc	2007-10-23 20:10:27 +05:00
> +++ b/sql/sql_parse.cc	2007-11-08 10:04:31 +04:00
> @@ -3027,10 +3027,11 @@ end_with_restore_list:
>    case SQLCOM_LOAD:
>    {
>      DBUG_ASSERT(first_table == all_tables && first_table != 0);
> +#ifndef NO_EMBEDDED_ACCESS_CHECKS
>      uint privilege= (lex->duplicates == DUP_REPLACE ?
>  		     INSERT_ACL | DELETE_ACL : INSERT_ACL) |
>                      (lex->local_file ? 0 : FILE_ACL);
> -
> +#endif

why ?

>      if (lex->local_file)
>      {
>        if (!(thd->client_capabilities & CLIENT_LOCAL_FILES) ||
> @@ -4028,8 +4027,10 @@ create_sp_error:
>        mysql_reset_errors(thd, 0);
>        if (sp_result == SP_OK)
>        {
> +#ifndef NO_EMBEDDED_ACCESS_CHECKS
>          char *db= lex->spname->m_db.str;
>  	char *name= lex->spname->m_name.str;
> +#endif

why ?
  
>  	if (check_routine_access(thd, ALTER_PROC_ACL, db, name,
>                                   lex->sql_command == SQLCOM_DROP_PROCEDURE, 0))
> @@ -4710,7 +4711,6 @@ check_access(THD *thd, ulong want_access
>    */
>    bool  db_is_pattern= (test(want_access & GRANT_ACL) &&
>                          dont_check_global_grants);
> -#endif
>    ulong dummy;
>    DBUG_ENTER("check_access");
>    DBUG_PRINT("enter",("db: %s  want_access: %lu  master_access: %lu",

As you see, check_access() has a side effect of updating *save_priv.
Is it safe to disable it completely ?

> @@ -6927,9 +6914,11 @@ bool insert_precheck(THD *thd, TABLE_LIS
>      Check that we have modify privileges for the first table and
>      select privileges for the rest
>    */
> +#ifndef NO_EMBEDDED_ACCESS_CHECKS
>    ulong privilege= (INSERT_ACL |
>                      (lex->duplicates == DUP_REPLACE ? DELETE_ACL : 0) |
>                      (lex->value_list.elements ? UPDATE_ACL : 0));
> +#endif

why ?
  
Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Dachauer Str. 37, D-80335 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB
München 162140
Thread
bk commit into 5.1 tree (holyfoot:1.2625) BUG#31960holyfoot8 Nov
  • Re: bk commit into 5.1 tree (holyfoot:1.2625) BUG#31960Sergei Golubchik12 Nov
  • Re: bk commit into 5.1 tree (holyfoot:1.2625) BUG#31960Alexey Botchkov13 Nov