Bug #65805 Roles.RemoveUserFromRole() requests data from wrong table name
Submitted: 4 Jul 2012 6:24 Modified: 28 Sep 2012 18:49
Reporter: Hans Larsen Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.5.4 OS:Windows
Assigned to: Fernando Gonzalez.Sanchez CPU Architecture:Any
Tags: findusersinroles, my_aspnet_usersinroles, Removeuserfromrole, roles

[4 Jul 2012 6:24] Hans Larsen
Description:
When using the asp.net web security functionality with a MySQL database, an issue occurs when using features which looks into the my_aspnet_usersinroles table. 

This causes this exception: "Exception Details: MySql.Data.MySqlClient.MySqlException: Table 'testdb.my_aspnet_usersinrole' doesn't exist.".

The reason is that the actual table name is "my_aspnet_usersinroles" and not, as the exception proclaims, "my_aspnet_usersinrole".

Seems to be a simple spelling error.

How to repeat:
1. Create an asp.net website/webapplication.
2. Follow MySQL guide to setup asp.net web security with MySQL as datasource.
3. Add users to the database and assign them some roles.
4. Try to remove the user from a role or find users in a role. (This will throw the exception).

Suggested fix:
The reason is that the actual table name is "my_aspnet_usersinroles" and not, as the exception proclaims, "my_aspnet_usersinrole". This should be quite easy to fix y adding the missing letter 's'.
[28 Jul 2012 14:09] Damien BRUN
Just checked 6.6 code, this has been fixed in RemoveUserFromRole() but not in FindUsersInRoles.

Connector.Net still query a table "my_aspnet_usersInRole". (RoleProvider.cs line 514).
[28 Sep 2012 18:49] John Russell
Added to changelog for 6.4.6, 6.5.5, 6.6.3: 

When using the ASP.net web security functionality with a MySQL
database, using features that access the my_aspnet_usersinroles table
caused an exception:

MySql.Data.MySqlClient.MySqlException: Table 'testdb.my_aspnet_usersinrole' doesn't exist.

For example, this error could occur when trying to remove the user from a role or find users
in a role. The fix corrects the spelling of the table name to my_aspnet_usersinroles.