History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: NH-32
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Mike Doerfler
Reporter: Peter Smulovics
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
NHibernate

ByteFX.Data was renamed to ByteFX.MySqlClient

Created: 30/Mar/04 05:50 AM   Updated: 27/Feb/07 03:00 PM
Component/s: Data Providers
Affects Version/s: beta-0.7
Fix Version/s: beta-0.7

File Attachments: 1. Zip Archive mysql-connector-net-patch.zip (17 kb)
2. XML File MySql.TestResult.xml (125 kb)
3. Text File MySQLDialect.cs.patch (2 kb)



 Description  « Hide
ByteFX.Data was renamed to ByteFX.MySqlClient by bytefx, so the driver for bytefx should be updated to load the command and connection object from the right dll.

Instead of
connectionType = System.Type.GetType("ByteFX.Data.MySqlClient.MySqlConnection, ByteFX.Data");
commandType = System.Type.GetType("ByteFX.Data.MySqlClient.MySqlCommand, ByteFX.Data");

connectionType = System.Type.GetType("ByteFX.Data.MySqlClient.MySqlConnection, ByteFX.MySqlClient");
commandType = System.Type.GetType("ByteFX.Data.MySqlClient.MySqlCommand, ByteFX.MySqlClient");
should be written.

As I saw, the internal naming of the namespaces and classes wasn't changed.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Mike Doerfler - 14/Apr/04 05:19 AM
Updated CVS external-bin and NHIbernate.Driver.ByteFXDataDriver to use the newest version. The Driver will attempt to fall back to the old version if the new Assembly can't be found.

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...

Mike Doerfler - 01/Sep/04 06:20 AM
http://lists.mysql.com/win32/15205

Nothing I can do other than wait for a fix to ByteFX.MySqlClient

Mike Doerfler - 28/Oct/04 12:32 PM
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 NH-57

Mike Doerfler - 03/Nov/04 07:31 AM
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.

Mike Doerfler - 04/Dec/04 03:46 PM
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.

Sergey Koshcheyev - 05/Dec/04 04:40 AM
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!

Mike Doerfler - 05/Dec/04 11:50 AM
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

Sergey Koshcheyev - 05/Dec/04 12:28 PM
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.

Sergey Koshcheyev - 05/Dec/04 01:37 PM
Here is a patch to MySQLDialect with the changes I mentioned, and also LIMIT support.

Mike Doerfler - 05/Dec/04 08:39 PM
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

Sergey Koshcheyev - 06/Dec/04 02:26 AM
Do you mean NH-164? (http://jira.nhibernate.org/browse/NH-164)
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...

Sergey Koshcheyev - 06/Dec/04 02:35 AM
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 :))

Sergey Koshcheyev - 06/Dec/04 12:12 PM
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.

Mike Doerfler - 19/Feb/05 09:17 AM
As many issues as can be fixed with MySql have been.

Mike Doerfler - 25/Feb/05 05:30 PM
0.7 was released