Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] newbie help with mysql, please

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] newbie help with mysql, please


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Chris Hyzer <>, Tom Zeller <>
  • Cc: Grouper Users Mailing List <>
  • Subject: RE: [grouper-users] newbie help with mysql, please
  • Date: Fri, 12 Dec 2008 02:38:28 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

Ok, I looked at the Grouper DDL code, and it is not hard to have this type of exception for mysql.  So I went ahead and put a fix in for this.

 

If mysql, I put the index on values at the first 333 chars.  If not mysql, it does what it used to do.  No problem. It works for me on mysql and oracle.

If you want to try it out, that would be good (Grouper HEAD).

 

Regards,

Chris

 

From: Chris Hyzer [mailto:]
Sent: Tuesday, December 09, 2008 3:38 PM
To: Tom Zeller
Cc: Grouper Users Mailing List
Subject: RE: [grouper-users] newbie help with mysql, please

 

> Does ddlutils check the charset ? max=333 for utf8 and max=1000 for latin1 AFAIK

 

 

No, but I think for this index 50 is fine (since the first 50 chars generally gives you the value), and its not a unique index… J  so 333 should be good for all too.

 

Regards,

Chris

 

From: [mailto:] On Behalf Of Tom Zeller
Sent: Tuesday, December 09, 2008 3:27 PM
To: Chris Hyzer
Cc: Grouper Users Mailing List
Subject: Re: [grouper-users] newbie help with mysql, please

 

On Tue, Dec 9, 2008 at 2:17 PM, Chris Hyzer <> wrote:

That's not good.  My mysql works fine, but I think it automatically tells the index to only use the first part of the col.  i.e. try this and see if it works:

CREATE INDEX attribute_field_value_idx ON grouper_attributes (field_id, value(767));

http://dev.mysql.com/doc/refman/5.0/en/create-index.html

 

Yes, works.

 


I only have 5.0.45, but it is windows...

I wonder if we should change ddlutils to account for this...

 

Does ddlutils check the charset ? max=333 for utf8 and max=1000 for latin1 AFAIK

 



Regards,
Chris



> -----Original Message-----
> From: [mailto:] On Behalf Of Tom
> Zeller
> Sent: Tuesday, December 09, 2008 2:39 PM
> To: Grouper Users Mailing List
> Subject: [grouper-users] newbie help with mysql, please
>
> When using Grouper 1.4.0 RC1 and mysql 5.0 and attempting to
> initialize via gsh -registry -check I receive "Specified key was too
> long; max key length is 1000 bytes".
>
> Help ? (I'm not using the utf8 charset.)
>
> Hopefully it's operator error. I don't have much experience with mysql.
>
> Thanks,
> TomZ
>
>
> mysql> CREATE INDEX attribute_field_value_idx ON grouper_attributes
> (field_id, value);
> ERROR 1071 (42000): Specified key was too long; max key length is 1000
> bytes
>
> mysql> describe grouper_attributes;
> +--------------------------+---------------+------+-----+---------+----
> ---+
> | Field                    | Type          | Null | Key | Default |
> Extra |
> +--------------------------+---------------+------+-----+---------+----
> ---+
> | id                       | varchar(128)  | NO   | PRI | NULL    |
> |
> | group_id                 | varchar(128)  | NO   | MUL | NULL    |
> |
> | field_id                 | varchar(128)  | NO   |     | NULL    |
> |
> | value                    | varchar(1024) | NO   |     | NULL    |
> |
> | hibernate_version_number | bigint(20)    | YES  |     | NULL    |
> |
> +--------------------------+---------------+------+-----+---------+----
> ---+
> 5 rows in set (0.00 sec)
>
> mysql> status;
> --------------
> ./mysql5  Ver 14.12 Distrib 5.0.67, for apple-darwin9.5.0 (i686) using
>  EditLine wrapper
>
> Connection id:          23
> Current database:       grouper
> Current user:           root@localhost
> SSL:                    Not in use
> Current pager:          stdout
> Using outfile:          ''
> Using delimiter:        ;
> Server version:         5.0.67 Source distribution
> Protocol version:       10
> Connection:             Localhost via UNIX socket
> Server characterset:    latin1
> Db     characterset:    latin1
> Client characterset:    latin1
> Conn.  characterset:    latin1
>
> grouper.hibernate.properties :
>
> hibernate.dialect               = org.hibernate.dialect.MySQL5Dialect
> hibernate.connection.driver_class = com.mysql.jdbc.Driver
> hibernate.connection.url = "jdbc:mysql://127.0.0.1:3306/grouper

 




Archive powered by MHonArc 2.6.16.

Top of Page