mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Bug #23675 Partitions: possible security breach via alter
now we return different error message if user doesn't have SELECT grants
This commit is contained in:
@@ -849,15 +849,27 @@ void partition_info::print_no_partition_found(TABLE *table)
|
||||
{
|
||||
char buf[100];
|
||||
char *buf_ptr= (char*)&buf;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
TABLE_LIST table_list;
|
||||
|
||||
if (part_expr->null_value)
|
||||
buf_ptr= (char*)"NULL";
|
||||
bzero(&table_list, sizeof(table_list));
|
||||
table_list.db= table->s->db.str;
|
||||
table_list.table_name= table->s->table_name.str;
|
||||
|
||||
if (check_single_table_access(current_thd,
|
||||
SELECT_ACL, &table_list, TRUE))
|
||||
my_message(ER_NO_PARTITION_FOR_GIVEN_VALUE,
|
||||
ER(ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT), MYF(0));
|
||||
else
|
||||
longlong2str(err_value, buf,
|
||||
part_expr->unsigned_flag ? 10 : -10);
|
||||
my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
{
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
if (part_expr->null_value)
|
||||
buf_ptr= (char*)"NULL";
|
||||
else
|
||||
longlong2str(err_value, buf,
|
||||
part_expr->unsigned_flag ? 10 : -10);
|
||||
my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
}
|
||||
}
|
||||
/*
|
||||
Set up buffers and arrays for fields requiring preparation
|
||||
|
Reference in New Issue
Block a user