data upload issue 2

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

data upload issue 2

okeeffe
Another issue is the database name.
It seems mysql only allows database names up to 64 characters long.
Time and again I'm getting Invalid database name errors due to overlong
database names.
The user's file name is only ~1/3 of the actual database name.
Can anything be done about this?

Could not create
userdata_Mouse_NCBIM37_362ce679bead827253b8ec92c34effe9_V_Input_1_razersIndel36_length36_cover_gff:
Incorrect database name
'userdata_Mouse_NCBIM37_362ce679bead827253b8ec92c34effe9_V_Input_1_razersIndel36_length36_cover_gff'

Thanks,
Sean.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: data upload issue 2

Lincoln Stein
Hi Sean,

Sorry! I didn't realize there was a limit on mysql database names. I can fix this.

Lincoln

On Tue, Jun 15, 2010 at 9:13 AM, Sean O'Keeffe <[hidden email]> wrote:
Another issue is the database name.
It seems mysql only allows database names up to 64 characters long.
Time and again I'm getting Invalid database name errors due to overlong
database names.
The user's file name is only ~1/3 of the actual database name.
Can anything be done about this?

Could not create
userdata_Mouse_NCBIM37_362ce679bead827253b8ec92c34effe9_V_Input_1_razersIndel36_length36_cover_gff:
Incorrect database name
'userdata_Mouse_NCBIM37_362ce679bead827253b8ec92c34effe9_V_Input_1_razersIndel36_length36_cover_gff'

Thanks,
Sean.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse



--
Lincoln D. Stein
Director, Informatics and Biocomputing Platform
Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Renata Musa <[hidden email]>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: data upload issue 2

Lincoln Stein
In reply to this post by okeeffe
It's too late for the 2.10 release, but here is a patch:

Index: lib/Bio/Graphics/Browser2/DataLoader.pm
===================================================================
--- lib/Bio/Graphics/Browser2/DataLoader.pm (revision 23381)
+++ lib/Bio/Graphics/Browser2/DataLoader.pm (working copy)
@@ -4,6 +4,7 @@
 use strict;
 use IO::File;
 use Carp 'croak';
+use Digest::MD5 'md5_hex';
 
 # for mysql to work, you must do something like this:
 # grant create on `userdata\_%`.* to 'www-data'@localhost
@@ -237,9 +238,7 @@
     my $backend   = $self->backend;
 
     if ($backend eq 'DBI::mysql') {
- my @components = split '/',$data_path;
- my $db_name    = 'userdata_'.join '_',@components[-3,-2,-1];
- $db_name       =~ s/[^a-zA-Z0-9_-]/_/g;
+ my $db_name    = 'userdata_'.md5_hex($data_path);
  $data_path     = $db_name;
  $self->dsn($db_name);
  my $mysql_admin = $self->mysql_admin;

Lincoln

On Tue, Jun 15, 2010 at 9:13 AM, Sean O'Keeffe <[hidden email]> wrote:
Another issue is the database name.
It seems mysql only allows database names up to 64 characters long.
Time and again I'm getting Invalid database name errors due to overlong
database names.
The user's file name is only ~1/3 of the actual database name.
Can anything be done about this?

Could not create
userdata_Mouse_NCBIM37_362ce679bead827253b8ec92c34effe9_V_Input_1_razersIndel36_length36_cover_gff:
Incorrect database name
'userdata_Mouse_NCBIM37_362ce679bead827253b8ec92c34effe9_V_Input_1_razersIndel36_length36_cover_gff'

Thanks,
Sean.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse



--
Lincoln D. Stein
Director, Informatics and Biocomputing Platform
Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Renata Musa <[hidden email]>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse