syntax error on varbinary(-1)
I am receiving a syntax error:
MySQL said: Documentation
#1064
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1) NULL, PRIMARY KEY (diagram_id), UNIQUE INDEX UK_principal_name (p' at line 6
This is what i am trying to run. i have looked t开发者_如何转开发hat the lines it is telling me is incorrect and i have yet to find the correct syntax to use. any help would be appreciated.
DROP TABLE IF EXISTS `teamfocus_dbo`.`sysdiagrams`;
CREATE TABLE `teamfocus_dbo`.`sysdiagrams` (
`name` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`principal_id` INT(10) NOT NULL,
`diagram_id` INT(10) NOT NULL AUTO_INCREMENT,
`version` INT(10) NULL,
`definition` VARBINARY(-1) NULL,
PRIMARY KEY (`diagram_id`),
UNIQUE INDEX `UK_principal_name` (`principal_id`, `name`)
)
ENGINE = INNODB;
Try changing the VARBINARY(-1)
to a positive length, like VARBINARY(1)
Pretty sure you can't have negative length columns... change VARBINARY(-1) to a positive length.
Maybe you're meaning to set the default value to -1?
`definition` VARBINARY(1) NULL DEFAULT -1
精彩评论