diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-04-04 14:01:47 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-04-04 14:01:47 +0500 |
commit | 93e11dce942e8aec8501982fe3e664a9d4abd471 (patch) | |
tree | ed0d8599026a089115032c4a19d06c1789df15cd /sql/partition_info.cc | |
parent | c242662096e1ce16b249c478702be54c190d3f5e (diff) | |
download | mariadb-git-93e11dce942e8aec8501982fe3e664a9d4abd471.tar.gz |
Bug #23675 Partitions: possible security breach via alter
now we return different error message if user doesn't have
SELECT grants
mysql-test/r/partition_grant.result:
test result
mysql-test/t/partition_grant.test:
testcase
sql/mysql_priv.h:
no_errors parameter added to check_single_table_access()
sql/partition_info.cc:
access rights control added to the print_no_partition()
sql/share/errmsg.txt:
message added
sql/sql_base.cc:
no_errors parameter added to check_single_table_access()
sql/sql_parse.cc:
no_errors parameter added to check_single_table_access()
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a7f9bd413c6..98c2e5432ab 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -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 |