|
|
|
tried upgrading to 1.0.1-beta version just released. They fixed the DbType in parameters NPE problem.
They introduced inconsistency with DbType.Time. The MySql.Data definition is perfect for MySql, but inconsistent with msdn docs (which I consider the authoritative source for how things should work). This has been documented in All test pass except:
some test make joins of more than 31 tables - this will go away with Proxies there is a problem with sql generated from hql - my sql doesn't like the spaces in: "( upper ( s.Name ) = 'SIMPLE 1' )" The rest of the issues are driver data type issues. Updated to gamma version of connector. Now I'm having problems with preparing selects - disabling preparing commands seems to help alot of test fixtures pass, but doesn't seem a good solution. Also some ALTER statements issued by hbm2ddl are not working now...
On a positive note, I did fix the problems with hql inserting extra spaces around things. Just for information, what version of MySQL are you using? I'm using 4.0.21 and I don't have any problems running the test suites, most probably because MySQL 4.0 doesn't support preparing commands :-)
Yes, the bug with functions is gone, thanks! I installed 4.1.7 on my xp machine and am using the MySql.Data 1.0.2-gamma release.
So you're not having any problems with the test suites? Which version of MySql.Data are you using? Mike I use 4.0.20 and Connector/NET version 1.0.2, but I had to modify the Connector to work with NHibernate (make it adhere to IDataReader specification and return a DateTime instead of MySqlDateTime, and round zero dates to DateTime.MinValue). There is already a bug report about dates in the MySQL bug database, but they seem to be slow at fixing bugs (unlike you ;-)). I also modified MySQL Dialect a bit, changing:
Register( DbType.Binary, 255, "VARCHAR($1) BINARY"); ... Register( DbType.Double, "FLOAT" ); to: Register( DbType.Binary, 127, "TINYBLOB"); ... Register( DbType.Double, "DOUBLE" ); Now most of the tests pass. The tests that fail are: * BasicTimeFixture - MySQL wants a TimeSpan for TIME column * ConfigurationFixture.ManualConfiguration - attempts to connect to an SQL Server database * MultiTableTest (MultiTable, MultiTableGeneratedId) - MySQL 4.0 doesn't support subselects and 'exists' function. Here is a patch to MySQLDialect with the changes I mentioned, and also LIMIT support.
Applied patch to MySQLDialect. Hard to tell if anything is working because practically every class used in testing has a DateTime property mapped :)
If you have a link to that MySql issue would you mind putting it in this jira. To think, this was just supposed to be a drop in the new data provider and close it issue - lol! Mike Do you mean
That most classes use DateTime shouldn't matter, only classes where it's mapped to a TIME column are problematic, but there are only a few and they are separated. My patch makes a test case using doubles and another one using byte arrays (I believe) pass, and also adds LIMIT's while not breaking any tests and I verified that the query in FooBarTest.Limit is executed with the limit clause. I myself thought I would just use this issue for all MySQL-related discussions, instead of creating many separate trivial issues... Ah, yes, I completely forgot about my changes to Connector/NET, that's what fixes problems with DateTimes. I will probably put them somewhere here later (have to work now :))
Here are my changes to Connector/NET. They're not in form of a patch, because I haven't found a suitable diff.exe that would work on directories. Instead I just zipped the files I have changed.
This patch changes MySqlDateTime to round DateTime.MinValue to a zero date (0000-00-00) on writes, and MySqlDataReader.Get() to return DateTime instead of MySqlDateTime. To convert zero dates to DateTime.MinValue (on reads) you have to also include RoundZeroDatetime=true option in your connection string, otherwise reading zero dates causes an exception. Actually, enabling the rounding is strongly recommended, otherwise you'll be able to write zero dates to the DB, but will not be able to read them back. As many issues as can be fixed with MySql have been.
|
||||||||||||||||||||||||||||||||||||||||||||||
I am running into problems with IType.BinaryType and IType.SerializableType throwing this exception:
Exception: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: NHibernate
at NHibernate.Persister.EntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session) in C:\Documents and Settings\MikeD\My Documents\sourceforge-sandbox\nhibernate-sandbox\nhibernate\src\NHibernate\Persister\EntityPersister.cs:line 651
at NHibernate.Impl.ScheduledInsertion.Execute() in C:\Documents and Settings\MikeD\My Documents\sourceforge-sandbox\nhibernate-sandbox\nhibernate\src\NHibernate\Impl\ScheduledInsertion.cs:line 21
at NHibernate.Impl.SessionImpl.ExecuteAll(ICollection coll) in C:\Documents and Settings\MikeD\My Documents\sourceforge-sandbox\nhibernate-sandbox\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 2272
at NHibernate.Impl.SessionImpl.Execute() in C:\Documents and Settings\MikeD\My Documents\sourceforge-sandbox\nhibernate-sandbox\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 2226
If I comment out the properties for BinaryProperty and SerializableProperty it all works okay. I guess this is not a simple drop and replace...