Quoting Steve Fink ([EMAIL PROTECTED]): > I couldn't find an explanation of this behavior in the docs. When I > use the following CREATE command: > > CREATE TABLE D6 (id int(10) not null unique); > > it appears to automatically create an index for me:
Argh! Never mind. Learn something new every day -- the 'unique' keyword *is* a definition of an index. Weird. So maybe I should change this to a feature request: when MySQL hits one of the kajillion wacky parts of SQL that implicitly name indexes, could it check whether its default name is a keyword before creating it? That's what breaks the reasonable expectation of mysql being able to read its own dump files: you create a table with an indexed column named 'version', and mysqldump renders that as 'KEY version(version)', which bombs, instead of (eg) 'KEY (version)', which would be fine. I suggest fixing it in the index naming because it already does fancy things like checking whether the new name already exists and appending a _2 or _3 if so. Thanks! --------------------------------------------------------------------- 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