From cec76b3861115a3141923ab892d7304afe623e41 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 9 Dec 2013 12:39:31 +0100 Subject: [PATCH] correct old assert in add_role_user_mapping_action to match changed function prototypes. fix the element deleting logic for roles_mappings_hash --- debian/dist/Ubuntu/control | 19 +++++++++++-------- sql/sql_acl.cc | 6 ++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index cf9c0e086fc..9979aff1b66 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -105,13 +105,15 @@ Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, - mariadb-client-5.3, mariadb-client-core-5.3 + mariadb-client-5.3, mariadb-client-core-5.3, + mariadb-client-5.5, mariadb-client-core-5.5 Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, - mariadb-client-5.3, mariadb-client-core-5.3 + mariadb-client-5.3, mariadb-client-core-5.3, + mariadb-client-5.5, mariadb-client-core-5.5 Description: MariaDB database core client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -127,11 +129,12 @@ Provides: virtual-mysql-client, mysql-client, mysql-client-4.1, mysql-client-5.1, mysql-client-5.5 Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mariadb-client (<< ${source:Version}), - mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, mysql-client-5.5 + mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, + mysql-client-5.5, mariadb-client-5.5 Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, - mysql-client-5.5, - mariadb-client (<< ${source:Version}), - mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3 + mysql-client-5.5, mariadb-client (<< ${source:Version}), + mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, + mariadb-client-5.5 Description: MariaDB database client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -185,11 +188,11 @@ Depends: mariadb-client-10.0 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, mariadb-server-5.5, mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, mariadb-server-5.5, libmariadbclient16 (<< 5.3.4), libmariadbclient-dev (<< 5.5.0), mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 Description: MariaDB database server binaries diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f6a0fda6495..5cf1e3097f4 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2415,7 +2415,7 @@ static void remove_role_user_mapping(ACL_USER_BASE *grantee, ACL_ROLE *role, static my_bool add_role_user_mapping_action(void *ptr, void *unused __attribute__((unused))) { ROLE_GRANT_PAIR *pair= (ROLE_GRANT_PAIR*)ptr; - my_bool status __attribute__((unused)); + bool status __attribute__((unused)); status= add_role_user_mapping(pair->u_uname, pair->u_hname, pair->r_uname); /* The invariant chosen is that acl_roles_mappings should _always_ @@ -2423,7 +2423,7 @@ static my_bool add_role_user_mapping_action(void *ptr, void *unused __attribute_ If add_role_user_mapping detects an invalid entry, it will not add the mapping into the ACL_USER::role_grants array. */ - DBUG_ASSERT(status >= 0); + DBUG_ASSERT(status == 0); return 0; } @@ -8759,6 +8759,8 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop, case ROLES_MAPPINGS_HASH: my_hash_delete(roles_mappings_hash, (uchar*) role_grant_pair); + if (idx != elements) + idx++; break; default: