Bug #60360 Edmx-generator doesnt care about default values defined for table columns
Submitted: 6 Mar 2011 12:50 Modified: 7 Mar 2011 11:29
Reporter: Igor Ovsyannikov Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.3.6 OS:Windows
Assigned to: CPU Architecture:Any
Tags: .net Connector, default values, edmx

[6 Mar 2011 12:50] Igor Ovsyannikov
Description:
Hello!

  I have read all the story about Bug #53188. You wrote that this bug verified with Connector/NET 6.3.5. But i have same problem while using Connector version 6.3.6.

  I create table:

CREATE TABLE `login` (
  `account_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `userid` varchar(23) NOT NULL DEFAULT '',
  `user_pass` varchar(32) NOT NULL DEFAULT '',
  `sex` enum('M','F','S') NOT NULL DEFAULT 'M',
  `email` varchar(39) NOT NULL DEFAULT '',
  `level` tinyint(3) NOT NULL DEFAULT '0',
  `state` int(11) unsigned NOT NULL DEFAULT '0',
  `unban_time` int(11) unsigned NOT NULL DEFAULT '0',
  `expiration_time` int(11) unsigned NOT NULL DEFAULT '0',
  `logincount` mediumint(9) unsigned NOT NULL DEFAULT '0',
  `lastlogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_ip` varchar(100) NOT NULL DEFAULT '',
  `birthdate` date NOT NULL DEFAULT '0000-00-00',
  PRIMARY KEY (`account_id`),
  KEY `name` (`userid`)
) ENGINE=MyISAM AUTO_INCREMENT=2000007 DEFAULT CHARSET=utf8;

then i create new edmx model, but CSDL doesnt contain default value defenitions:

<Property Name="account_id" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="birthdate" Type="DateTime" Nullable="false" />
          <Property Name="email" Type="String" Nullable="false" />
          <Property Name="expiration_time" Type="Int64" Nullable="false" />
          <Property Name="lastlogin" Type="DateTime" Nullable="false" />
          <Property Name="last_ip" Type="String" Nullable="false" />
          <Property Name="level" Type="SByte" Nullable="false" />
          <Property Name="logincount" Type="Int32" Nullable="false" />
          <Property Name="sex" Type="String" Nullable="false" />
          <Property Name="state" Type="Int64" Nullable="false" />
          <Property Name="unban_time" Type="Int64" Nullable="false" />
          <Property Name="userid" Type="String" Nullable="false" />
          <Property Name="user_pass" Type="String" Nullable="false" />
...

May be i do something wrong. Please, help me to fix this issue.

How to repeat:
For repeat this bug just create table on mysql server and then create edmx model in Visual Studio using.

Suggested fix:
It can be fixed manualy, but there could be a lot of table and columns in database.
[6 Mar 2011 19:18] Valeriy Kravchuk
This is a duplicate of Bug #53188.
[7 Mar 2011 11:29] Igor Ovsyannikov
Yes, it is duplicate of #53188, i have wrote about it in the very begining. But this trouble still exists and i consider there is no solution yet.
[26 Feb 2013 9:25] emre goc
Is there any improvement about this problem?