mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Two Sprint tasks and two behaviour changes.
sql/sql_acl.cc: Fix for a grant bug. If there is a table privilege, for which no column privileges are defined , and the same privilege is granted for a column, new code prevents that table privilege is reduced to a column privilege. To accomplish that, now a REVOKE command has to be used first. sql/sql_parse.cc: SCRUM TASK No 1. Adding support for INSERT .. SELECT with a table in the join that is to be inserted into. test case pending. sql/sql_union.cc: Changing behaviour for SQL_OPTION_FOUND_ROWS in unins. sql/sql_yacc.yy: SCRUM TASK no 2. Making CREATE and INSERT to work with any UNION>
This commit is contained in:
@ -2038,7 +2038,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
||||
check->column.c_ptr(), table_list->alias);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
column_priv |= check->rights | (rights & COL_ACLS);
|
||||
column_priv |= check->rights & COL_ACLS;
|
||||
}
|
||||
close_thread_tables(thd);
|
||||
}
|
||||
@ -2173,7 +2173,12 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
||||
}
|
||||
else
|
||||
{
|
||||
column_priv|= grant_table->cols;
|
||||
/*
|
||||
This code makes sure that if there is X privilege on the entire table and
|
||||
X can be also a column privilege, that granting column privilege does not
|
||||
revoke a table privilege.
|
||||
*/
|
||||
column_priv&= ~(grant_table->privs & ~grant_table->cols);
|
||||
}
|
||||
|
||||
|
||||
@ -2186,13 +2191,13 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
||||
{ // Crashend table ??
|
||||
result= -1; /* purecov: deadcode */
|
||||
}
|
||||
else if (tables[2].table)
|
||||
else if (tables[2].table && (column_priv | revoke_grant))
|
||||
{
|
||||
if ((replace_column_table(grant_table,tables[2].table, *Str,
|
||||
columns,
|
||||
table_list->db,
|
||||
table_list->real_name,
|
||||
rights, revoke_grant)))
|
||||
(revoke_grant) ? rights : column_priv, revoke_grant)))
|
||||
{
|
||||
result= -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user