MySQL Forums
Forum List  »  InnoDB

I find problem/bug
Posted by: Mauro Mattana
Date: October 10, 2008 04:18AM

HAhahahaah i find where is problem/BUG:

CREATE TABLE User
(
UserID CHAR(20) PRIMARY KEY,
Plus DATETIME DEFAULT '2008-01-01 01:01:01',
INDEX (Plus, UserID)
)
ENGINE = InnoDB;


CREATE TABLE Areas
(
Belong CHAR(20),
PlusOn DATETIME DEFAULT '2008-01-01 01:01:01',
INDEX (Belong, PlusOn),
PRIMARY KEY (Belong),
FOREIGN KEY (Belong) REFERENCES User (UserID) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (PlusOn) REFERENCES User (Plus) ON UPDATE CASCADE ON DELETE CASCADE
)
ENGINE = InnoDB;

Cut and paste this code and all work. But if in fist table "User" i change the 5° line from "INDEX (Plus, UserID)" to "INDEX (UserID, Plus)". I get error "ERROR 1005 (HY000): Can't create table 'test.areas' (errno: 150)"
I think is bug!


CREATE TABLE User
(
UserID CHAR(20) PRIMARY KEY,
Plus DATETIME DEFAULT '2008-01-01 01:01:01',
INDEX (UserID, Plus)
)
ENGINE = InnoDB;


CREATE TABLE Areas
(
Belong CHAR(20),
PlusOn DATETIME DEFAULT '2008-01-01 01:01:01',
INDEX (Belong, PlusOn),
PRIMARY KEY (Belong),
FOREIGN KEY (Belong) REFERENCES User (UserID) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (PlusOn) REFERENCES User (Plus) ON UPDATE CASCADE ON DELETE CASCADE
)
ENGINE = InnoDB;

thx to all people help me to find problem

Options: ReplyQuote


Subject
Views
Written By
Posted
I find problem/bug
3450
October 10, 2008 04:18AM
2904
October 12, 2008 04:57PM
2311
October 13, 2008 11:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.