Bug #40936 autogenerateschema creates wrong column name for roles table
Submitted: 21 Nov 2008 18:17 Modified: 9 Jan 2009 7:41
Reporter: jim jones Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.2.5.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[21 Nov 2008 18:17] jim jones
Description:
When using the autogenerateschema tag in the machine.config the MySQL Connector/NET created a table called my_aspnet_Roles with a column named "Rolename". Therefore you cannot enter the Role management in ASP.NET Configuration. Instead you receive an error "Unknown column 'r.name' in 'field list'".

Workaround: Rename the column "Rolename" to "name" than you can use the Role management in the ASP.NET Configuration.

How to repeat:
- Install Visual Webdeveloper 2008 Express
- Install MySQL Connector/NET 5.2.5.0
- Create a new web project 
- Add a reference: C:\Program Files\MySQL\MySQL Connector Net 5.2.1\Web Providers\MySql.Web.dll
- Open the machine.config located in C:\Windows\Microsoft.NET\Framework\v2.0.50727
- Enter the parameter autogenerateschema="true" to the existing membership provider entry (and save it):
<membership>
<providers>
<add name=”MySQLMembershipProvider” autogenerateschema=”true” …
</providers>
- add a connection string to your web.config
- build the web project
- open ASP.NET configuration and select the mysql-stuff as default provider.
- try to add a role

Suggested fix:
rename the tablename "Rolename" to "name".
[21 Nov 2008 18:47] jim jones
i set up a local mysql 5.0 database. it works with this database.
but it does not work with my shared hoster www.hosteurope.de. maybe because they run mysql under linux!?
[3 Dec 2008 20:05] Reggie Burnett
jim

the sql script that is executed to setup the tables should leave the name of that column as 'name'.  If it doesn't then something is causing that script to fail.  Are you running mysql on linux? Are you using a non-default value for lower_case_table_names?
[9 Dec 2008 7:41] Tonci Grgin
Changing status to appropriate one.
[10 Jan 2009 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[17 Aug 2009 20:02] Morten Holst
I have the similar problem as described earlier. I use MySQL connector 6.0.4.0, and I am running MySQL under Linux.

I got the same error, and using the workaround got me a step closer to making it work. After altering the column name I don't get the "Unknown column 'r.name' in 'field list'".

However...

When i try to create a user from the .NET Website the user is created, but it fails to create the membership part of the user, containing password etc. therefore rendering the user useless.
[13 Jan 2010 0:55] Carl Edwards
I am having this problem in the newest release (6.2.2)

After renaming Rolename to name I was able to get farther but now the error when attempting to add a new role is:
"Column count doesn't match value count at row 1"