-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: H3 SchemaUpdate tool/MySQL 4.1.14 - key length too long
PostPosted: Wed Oct 05, 2005 1:13 pm 
Regular
Regular

Joined: Tue Dec 09, 2003 2:39 pm
Posts: 106
Location: Toronto, Canada
Using the Hibernate 3 schema export tool does not work with MySQL 4.1.14 for our model because MySQL complains that:

Quote:
Specified key was too long; max key length is 1024 bytes


Because a UTF-8 character is stored as three bytes in MySQL the maximum key length can only be 1024/3 characters long. The compound key in many of our tables seem to be violating this constraint.

Scowered and only came up with this: http://jira.atlassian.com/browse/CONF-2783

So, are the only options to:

    1. Change the character encoding, or
    2. Reduce size of varchar columns


Can someone with MySQL with SchemaUpdate verify that and describe what properties they are sending in their connection URL (using connectorJ)? I've played with the various driver URL options here http://dev.mysql.com/doc/connector/j/en/cj-configuration-properties.html

Also, is there a way specify the length on an ID field? Assume we are using UUID.HEX and I want the varchar to be of length 32, rather than the default it seems to be using for 255.

Thanks,
Roll


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 3:14 pm 
Regular
Regular

Joined: Tue Dec 09, 2003 2:39 pm
Posts: 106
Location: Toronto, Canada
Mmm... okay. This appears to be a bug in MySQL:

http://bugs.mysql.com/bug.php?id=4541

There appears to be a number of workarounds below:

1) Adjust character set for columns to be latin1., or

2) Specify character set to be used by driver. Either by driver URL (still would like to hear of someone using ConnectorJ successfully here) or using the Hibernate connection properties.

eg. hibernate.connection.charSet=latin1

For option #1, can we somehow specify character sets on individual columns somehow in our mappings? I don't want latin1 for everything which I think option #2 implies.

Am I missing something?

Thanks,
Roll


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.