mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-secfix
This commit is contained in:
@ -2682,12 +2682,11 @@ unsent_create_error:
|
||||
case SQLCOM_REPLACE:
|
||||
case SQLCOM_INSERT:
|
||||
{
|
||||
my_bool update= (lex->value_list.elements ? UPDATE_ACL : 0);
|
||||
if ((res= insert_precheck(thd, tables, update)))
|
||||
if ((res= insert_precheck(thd, tables)))
|
||||
break;
|
||||
res = mysql_insert(thd,tables,lex->field_list,lex->many_values,
|
||||
select_lex->item_list, lex->value_list,
|
||||
(update ? DUP_UPDATE : lex->duplicates));
|
||||
lex->duplicates);
|
||||
if (thd->net.report_error)
|
||||
res= -1;
|
||||
break;
|
||||
@ -5366,13 +5365,14 @@ int delete_precheck(THD *thd, TABLE_LIST *tables)
|
||||
-1 error (message is not sent to user)
|
||||
*/
|
||||
|
||||
int insert_precheck(THD *thd, TABLE_LIST *tables, bool update)
|
||||
int insert_precheck(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
LEX *lex= thd->lex;
|
||||
DBUG_ENTER("insert_precheck");
|
||||
|
||||
ulong privilege= (lex->duplicates == DUP_REPLACE ?
|
||||
INSERT_ACL | DELETE_ACL : INSERT_ACL | update);
|
||||
ulong privilege= INSERT_ACL |
|
||||
(lex->duplicates == DUP_REPLACE ? DELETE_ACL : 0) |
|
||||
(lex->duplicates == DUP_UPDATE ? UPDATE_ACL : 0);
|
||||
|
||||
if (check_one_table_access(thd, privilege, tables))
|
||||
DBUG_RETURN(1);
|
||||
|
Reference in New Issue
Block a user