Different MySQL 4.1 issues

Description

MySQL (version 4.1.8) uses non-standard syntax for dropping (foreign key) constraints. The syntax is 'alter table ... drop foreign key <name>' instead of 'alter table ... drop constraint <name>'. But this can't be changed by changing the MySQLDialect, since it's hard-coded in Mapping/Constraint.cs.

Also, from my investigation, MySQL 4.1.8 DOES require dropping constraints before dropping the table, contrary to what documentation says and what the MySQLDialect is set to.

And another bug (this time it's MySQL's fault, I write about it here just in case you're interested ) is that it doesn't allow rows to reference themselves. This causes MultiTable tests to fail. I'll report it to MySQL developers.

Environment

None

Attachments

2

Activity

MikeM 
February 25, 2005 at 4:29 PM

0.7 was released

MikeM 
February 8, 2005 at 7:12 PM

patch applied for MySql ddl generation. Has no affect on tests run with MsSql.

Bill Hawes 
February 4, 2005 at 9:39 AM

Mike

Everything seems to work fine with older versions of MySQL.

Bill

Bill Hawes 
February 3, 2005 at 9:31 AM

Mike

I have tried with MySQL 3.23.57. The 'ALTER TABLE ... DROP FOREIGN KEY ...' statement executes without error, but is ignored. Dropping the referenced table works succesfully without dropping the constraint. This suggets that the patch should work with earlier versions.

I haven't had a chance to test this version of MySQL with hbm2ddl yet - I'll look at that tomorrow.

Bill

MikeM 
February 3, 2005 at 6:39 AM

Hi Bill, do these changes work with versions of MySql before 4.1 or do I need to create a new MySql41Dialect?

Thanks for the patch! I'll probably get it applied this weekend.

Mike

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Who's Looking?

Open Who's Looking?
Created December 18, 2004 at 11:10 AM
Updated February 25, 2005 at 4:29 PM
Resolved February 8, 2005 at 7:12 PM
Who's Looking?