|
|
Unknow data type
Last post 08-11-2007, 5:46 PM by kwilder. 15 replies.
-
07-17-2007, 8:05 PM |
-
07-18-2007, 12:39 AM |
-
pritcham
-
-
-
Joined on 01-29-2007
-
-
Posts 672
-
-
|
Hi
I think that this is more likely 'fixable' in MyGeneration rather than EntitySpaces as I understand that it is MyGeneration that does the mapping between the DB Type and the .Net Type. It might be worth checking in MyGeneration to find out what it is trying to map the UINT to.
Cheers
Martin
|
|
-
07-18-2007, 5:36 AM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 2,830
-
-
|
David is our MySQL guru but I suspect it's this int(10) can't you just use int ... Let's see what David has to say.
EntitySpaces | Twitter | BLOG | Please honor our Software License
|
|
-
07-18-2007, 5:39 AM |
|
|
We have extensive NUnit tests for MySQL's unsigned data types. In fact, EntitySpaces has sacrificed CLS-compliance in order to support them. My first suggestion would be to update to the latest Connector 5.0.7. When we first attempted to test 5.0.6, we ran into so many issues, that were also reported in the MySQL forums, that we reverted back to 5.0.3.
http://community.entityspaces.net/forums/thread/2384.aspx
BTW, 5.0.7 is no longer a special FTP download. It is the latest official download.
Another thing to consider, although it does not affect unsigned types, is the use of the InnoDb engine. MyISAM does not support foreign key constraints or transactions. I would reserve MyISAM tables to just those where it's features are needed.
http://community.entityspaces.net/forums/thread/11.aspx
Make sure you are using the latest MyGeneration, EntitySpaces, and MySQL Connector/NET. You should not be having problems with unsigned data types.
David Neal Parsons www.entityspaces.net
|
|
-
07-18-2007, 6:12 AM |
|
|
BTW, int(10) should not be a problem. That is a MySQL thing. The number in parenthesis is for display purposes and does not affect how it is stored in the database, or how it is retrieved by EntitySpaces. Here is one of our test tables:
Code:DROP TABLE IF EXISTS `aggregatedb`.`mysqltypetest2`;
CREATE TABLE `aggregatedb`.`mysqltypetest2` (
`ID` int(10) unsigned NOT NULL auto_increment,
`VarCharType` varchar(20) collate latin1_general_ci default NULL,
`CharType` char(1) collate latin1_general_ci default NULL,
`TimeStampType` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`DateType` date default NULL,
`DateTimeType` datetime default NULL,
`BlobType` blob,
`TextType` text collate latin1_general_ci,
`TimeType` time default NULL,
`LongTextType` longtext collate latin1_general_ci,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
David Neal Parsons www.entityspaces.net
|
|
-
07-18-2007, 6:23 AM |
|
|
Might as well toss in the unsigned test table. Notice that one table tests auto-incrementing signed and one is unsigned. It's hard to test for every possible combination of data types for every supported database, but I think we have this one covered. If there is sill a problem after upgrading the Connector, we'll investigate further, but our MySQL unit tests pass for both 5.0.3 and 5.0.7.
Code:DROP TABLE IF EXISTS `aggregatedb`.`mysqltypetest`;
CREATE TABLE `aggregatedb`.`mysqltypetest` (
`ID` int(11) NOT NULL auto_increment,
`BigIntType` bigint(20) default NULL,
`IntType` int(11) default NULL,
`MedIntType` mediumint(9) default NULL,
`SmallIntType` smallint(6) default NULL,
`TinyIntType` tinyint(4) default NULL,
`BigIntUType` bigint(20) unsigned default NULL,
`IntUType` int(10) unsigned default NULL,
`MedIntUType` mediumint(8) unsigned default NULL,
`SmallIntUType` smallint(5) unsigned default NULL,
`TinyIntUType` tinyint(3) unsigned default NULL,
`FloatType` float default NULL,
`FloatUType` float unsigned default NULL,
`DecType` decimal(10,0) default NULL,
`DecUType` decimal(10,0) unsigned default NULL,
`NumType` decimal(10,0) default NULL,
`NumUType` decimal(10,0) unsigned default NULL,
`DblType` double default NULL,
`DblUType` double unsigned default NULL,
`RealType` double default NULL,
`RealUType` double unsigned default NULL,
`BitType` bit(1) default NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
David Neal Parsons www.entityspaces.net
|
|
-
07-18-2007, 6:39 AM |
|
|
One last thing... We have not tested against Connector 5.1.x. It is still in Beta. They have changed some things regarding how the schema is reported and added some data types. There are already some issues about them reported in the MyGeneration forums that were fixed my installing the official 5.0.7 release.
David Neal Parsons www.entityspaces.net
|
|
-
07-18-2007, 8:46 AM |
-
SixthSense
-
-
-
Joined on 07-01-2007
-
-
Posts 5
-
-
|
Thanks to all of you. I am using Connector 5.0.7.0 and latest version of mygeneration too. The problem still exists. Please let me know how to send you sample project having this problem. I am sure this will help you to get the problem as you have complete source. Regards,
|
|
-
07-18-2007, 10:35 AM |
-
07-20-2007, 2:27 PM |
|
|
There is a problem with assembly redirection and INT UNSIGNED. INT works fine with redirection, and both signed and unsigned versions work without assembly redirection for both Connector 5.0.3, and recompiling the provider with 5.0.7. Unfortunately, there is nothing we can do about it short of issuing a version updated to 5.0.7, or telling you not to use unsigned ints. This is either a Connector bug, a redirection issue, or both. It is not EntitySpaces.
When I step through this line:
MySqlDbType dbType = MySqlDbType.UInt32;
This is what the Watch window shows for the dbType variable:
Name Value Type ------ ------ ---------------------------------- dbType 1027 MySql.Data.MySqlClient.MySqlDbType
That bizarre value causes Save to throw this Exception:
MySql.Data.MySqlClient.MySqlException was unhandled by user code Message="Unknown data type" Source="EntitySpaces.Core"
If I change to a signed INT and regen, it works with redirection: dbType Int32 MySql.Data.MySqlClient.MySqlDbType
If I get rid of redirection in the config and use either 5.0.3, or a recompiled provider with 5.0.7, it works with INT UNSIGNED:
dbType UInt32 MySql.Data.MySqlClient.MySqlDbType
I also tried InnoDb tables rather than your MyISAM, and LoaderMT in addition to your full trust Loader. Nothing made any difference.
Attached is a zipped up v0.0709.0 EntitySpaces.MySqlClientProvider.dll linked to the latest (but who knows for how long) MySQL Connector/NET 5.0.7. It passes NUnit tests and will be part of the next maintenance release. This will hopefully hold you over until then.
EntitySpaces.MySqlClientProvider.zip
EDIT: As of EntitySpaces 2007 v0.0730, the above zip is not necessary. The EntitySpaces MySqlClientProvider in EntitySpaces Developer and Trial is already linked to MySQL Connector/NET 5..0.7.
David Neal Parsons www.entityspaces.net
|
|
-
07-21-2007, 9:36 PM |
-
SixthSense
-
-
-
Joined on 07-01-2007
-
-
Posts 5
-
-
|
Thanks David, This problem is not only with MySQL Connector 5.0.7.0, but its with all versions later than 5.0.3.0, so its hard to believe that there is problem with connector or .net framework how it handles assembly redirection. I understand that MySQL might have made changes into their driver in order to improve its performance and incorporate new features, but you need at least to root out what is problem. I am sure there must be some thing wrong now with your implementation as it was specific to 5.0.3.0 as you tested yourself and said that it works with int signed but not with unsigned integers, so I am sure there must be to find out. although I have abandon the idea of using unsigned integers at moment, but you know we can't survive without it. It's ok until application is in development stage, but have to revert back to unsigned to hold maximum numbers. Hope to see you with answer soon and also a quick patch.
|
|
-
07-22-2007, 7:45 AM |
|
|
I'm confused. My previous post contains a link to an upgraded EntitySpaces MySql provider that works with MySQL Connector 5.0.7 for both signed and unsigned types. Did you try it?
The EntitySpaces MySql provider does not contain Connector 5.0.3 specific code. The line of code in question is pure Connector API, has not changed since EntitySpaces was first release under Connector 1.x, and did not require any code change to get it to work under 5.0.7. It's just re-compiled referencing Connector 5.0.7, so no assembly redirection is necessary.
MySqlDbType dbType = MySqlDbType.UInt32;
If that enumeration returns "1027" from the Connector with a redirected assembly, and "UInt32" without redirection, then that is not an EntitySpaces implementation bug. Any time and effort spent on our part to track down the precise cause of the problem is better spent improving EntitySpaces. I suspect that the end result would be to update the EntitySpaces provider to use the latest MySQL Connector, so we did that. 
David Neal Parsons www.entityspaces.net
|
|
-
07-22-2007, 9:49 PM |
-
08-11-2007, 2:56 PM |
-
kwilder
-
-
-
Joined on 03-22-2007
-
-
Posts 150
-
-
|
Hi, I'm getting the same "Unknown data type" error. I've downloaded the EntitySpaces.MySqlClientProvider.zip file. Where do I copy the DLL file? Do I copy the file into my project?
Thanks.
King Wilder http://www.kingwilder.com
|
|
-
08-11-2007, 5:06 PM |
|
|
The zip file previously available in this thread was a quick patch to 2007.0.0709 until we could get 2007.0.0730 out. I've removed the link to avoid further confusion. If you are using EntitySpaces 2007.0.0730 and MySQL Connector.NET 5.0.7, that issue should be resolved.
If you have a different set of circumstances causing that error, please start a new thread, and give us some more details, such as a code snippet which causes the exception, and the stack trace.
David Neal Parsons www.entityspaces.net
|
|
Page 1 of 2 (16 items)
1
|
|
|