View Full Version : MyChenQL, part 6
filburt1
01-02-2003, 08:15 PM
...while making a table in PMA:
Error
SQL-query :
CREATE TABLE `settings` (
`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`varname` VARCHAR( 255 ) NOT NULL ,
`prettyname` VARCHAR( 255 ) NOT NULL ,
`description` TEXT NOT NULL ,
`isboolean` TINYINT( 1 ) UNSIGNED NOT NULL ,
`value` TEXT NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE (
`varname` ,
`prettyname`
)
)
MySQL said:
Specified key was too long. Max key length is 500
Huh?
Xenon
01-02-2003, 08:24 PM
???
change int(11) into int (10)...
maybe that's the reason why vb always use int 10
filburt1
01-02-2003, 08:53 PM
I've made all the other tables in my database have int(11) for the project I'm working on with the exact same attributes (primary auto_increment unsigned) and they work.
Xenon
01-02-2003, 09:04 PM
hmm, maybe the length of all keys summed up is to long...
try to shorten varname to varchar(200) and retry
filburt1
01-02-2003, 09:07 PM
Nope, not the problem either; all the other tables are using 255, too.
mysql> describe posts;
+--------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | | PRI | NULL | auto_increment |
| subject | varchar(255) | | | | |
| contents | text | | | | |
| threadid | int(11) | | UNI | 0 | |
| datetime | int(11) | | | 0 | |
| posteruserid | int(11) | | | 0 | |
+--------------+------------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)
Xenon
01-02-2003, 09:16 PM
yeah but you forgot, there the subject is not a unique key, in your query above varname is a unique key :)
just try out to change it, we will see if i'm right or not :)
filburt1
01-02-2003, 09:17 PM
Well what I did was remove UNIQUE for the two columns and it worked. I don't understand why it wouldn't allow two unique columns though, I mean what I want is no two identical varnames and no two identical prettynames...
filburt1
01-02-2003, 09:18 PM
Pfft, making them unique after creating the table worked. I wonder if it's a MySQL bug or something; a though occurs: 255 + 255 > 500 so maybe that's what it was griping about.
*is completely confused*
Xenon
01-03-2003, 09:18 PM
hmm, i think i've said that above?
maybe the length of all keys summed up is to long...
try to shorten varname to varchar(200) and retry
so i think another MyChenQL thing i could solve and learn from it :)
filburt1
01-03-2003, 10:00 PM
Meh, for now I'll just make it 255 in the install script and then make them unique right after creating the table :)
Xenon
01-04-2003, 09:56 AM
well, the question now is: does it work properly now, or are there any (perhpas unseen) problems when the full keylength is over 500
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.