View Single Post

   
  #2 (permalink)  
Old 03-17-2008, 06:13 AM
Rob Wultsch
 
Posts: n/a
Default Re: #1005 - Can't create table '.\unb2test\#sql-770_2.frm' (errno: 150)

On Thu, Mar 13, 2008 at 12:33 PM, Yves Goergen
<nospam.list@unclassified.de> wrote:

> CREATE TABLE "message" (
> "MessageId" INTEGER UNSIGNED NOT NULL PRIMARY KEY,
> "Owner" INTEGER UNSIGNED NOT NULL,
> "SearchRevision" INTEGER UNSIGNED)
> ENGINE 'InnoDB' CHARACTER SET 'utf8' COLLATE 'utf8_bin';
>
> CREATE TABLE "message_revision" (
> "MessageId" INTEGER UNSIGNED NOT NULL,
> "RevisionNumber" SMALLINT UNSIGNED NOT NULL,
> "Author" INTEGER UNSIGNED NOT NULL,
> PRIMARY KEY ("MessageId", "RevisionNumber"))
> ENGINE 'InnoDB' CHARACTER SET 'utf8' COLLATE 'utf8_bin';
>


> ALTER TABLE "message" ADD FOREIGN KEY ("MessageId", "SearchRevision")
> REFERENCES "message_revision" ("MessageId", "RevisionNumber") ON DELETE
> CASCADE;
>


> #1005 - Can't create table '.\unb2test\#sql-770_2.frm' (errno: 150)



I am guessing it is an issue with "SearchRevision" being an INTEGER,
and "RevisionNumber" being a SMALLINT.

http://www.google.com/search?q=150+error+mysql yields
http://bugs.mysql.com/bug.php?id=6188 as it's first result.

"InnoDB does not give a clear error message if you try to create a
table with one or more
column types that do not match the column types of foriegn keys that
had been established
against that table."

--
Rob Wultsch
Reply With Quote