Hi:

Consider (default table type set to InnoDb, mysql
3.23.52):

CREATE TABLE A (
 id                   INTEGER NOT NULL AUTO_INCREMENT,
 name                 VARCHAR(20), PRIMARY KEY (id)
);

CREATE TABLE B (
 id                   INTEGER NOT NULL AUTO_INCREMENT,
 AID                  INTEGER NOT NULL,
 name                 VARCHAR(20),
 PRIMARY KEY (id), 
 FOREIGN KEY (AID)    REFERENCES A  (id)
                      ON DELETE CASCADE, 
 INDEX(AID) 
);

This is valid SQL and the FK constraint (cascaded
delete) works fine. Now using the latest J/Connect 
JDBC driver, we see the following (where md is the
database meta data object):

ResultSet r1 = md.getImportedKeys();
ResultSet r1 = md.getImportedKeys();

In both of these result sets (r1 and r2) the following
columns:

UPDATE_RULE and DELETE_RULE 

always return 4 ("set default"). 

The question is: is this correct behavior given
the cascade constraint set on the tables ? (It *is*
possible that this is correct if the rules apply
to the behavior of the *keys* themselves since
innodb doesn't yet support updates of the key values
themselves). Looking at the JDBC API, it's not clear
if there is any other way to get foreign key
constraints
either... 

Best regards,

--j

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to