List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:October 15 2007 8:14pm
Subject:Re: bk commit into 4.1 tree (tnurnberg:1.2675) BUG#20901
View as plain text  
Hi!

On Oct 08, Tatjana A Nuernberg wrote:
> ChangeSet@stripped, 2007-10-08 10:53:50+02:00, tnurnberg@stripped +5 -0
>   Bug #20901: CREATE privilege is enough to insert into a table
>   
>   CREATE TABLE IF NOT EXISTS ... SELECT let you insert into an existing
>   table as long as you had the CREATE privilege.
>   CREATE ... SELECT variants now always require INSERT privilege on target table.
> 
> diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
> --- a/sql/sql_parse.cc	2007-06-12 14:47:34 +02:00
> +++ b/sql/sql_parse.cc	2007-10-08 10:53:48 +02:00
> @@ -2583,9 +2583,10 @@ mysql_execute_command(THD *thd)
>        if (unit->select_limit_cnt < select_lex->select_limit)
>  	unit->select_limit_cnt= HA_POS_ERROR;	// No limit
>  
> -      if (!(res=open_and_lock_tables(thd,tables)))
> +      if (!check_table_access(thd, INSERT_ACL, create_table,0) &&
> +          !(res=open_and_lock_tables(thd,tables)))
>        {
> -	res= -1;				// If error
> +        res= -1;                                // If error
>          /*
>            select_create is currently not re-execution friendly and
>            needs to be created for every execution of a PS/SP.

1. Why did you add the check here, and not where CREATE_ACL is checked ?
2. do it in 5.1

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 4.1 tree (tnurnberg:1.2675) BUG#20901Tatjana A Nuernberg8 Oct
  • Re: bk commit into 4.1 tree (tnurnberg:1.2675) BUG#20901Sergei Golubchik15 Oct
    • Re: bk commit into 4.1 tree (tnurnberg:1.2675) BUG#20901Tatjana Azundris Nurnberg18 Oct