Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 64766
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: felix.ostmann [...] thewar.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.07002
Fixed in: (no value)



Subject: Database schemaname with special chars
if the schema has a name like "my-schema" the exporter cannot export the tables from the schema, because sub _tables_list cannot handle it (from D::C::S::L::DBI). in _tables_list are some regex that parse @tables (from the db) which can be: my_schema.my_table "my-schema".my_table my_schema."my-table" "my-schema"."my-table" The regex does NOT the correct job! I was not to able to create a failing test for that :-/ But simple checking that regex can show that (attached script will print): my_schema.my_table VS my_table "my-schema".my_table VS my-schema.my_table my_schema."my-table" VS my-table "my-schema"."my-table" VS my-table Our schemaname has a minus :-/ Perhaps checking a schemaname with a _namesep in it should be a good idear.
Subject: test.pl
my $self = { _quoter => '"', _namesep => '.', }; foreach my $table (qw/ my_schema.my_table "my-schema".my_table my_schema."my-table" "my-schema"."my-table" /) { my @tables = ($table); my $qt = qr/[\Q$self->{_quoter}\E"'`\[\]]/; my $all_tables_quoted = (grep /$qt/, @tables) == @tables; if ($self->{_quoter} && $all_tables_quoted) { s/.* $qt (?= .* $qt )//xg for @tables; } else { s/^.*\Q$self->{_namesep}\E// for @tables; } s/$qt//g for @tables; print "$table VS $tables[0]\n"; }
Subject: Re: [rt.cpan.org #64766] Database schemaname with special chars
Date: Fri, 14 Jan 2011 03:34:19 -0500
To: bug-DBIx-Class-Schema-Loader [...] rt.cpan.org
From: Rafael Kitover <rkitover [...] cpan.org>
Hi Felix, it will be a while before I can fix this. Are you able to work around the issue for now by changing the regex? On 1/14/2011 3:31 AM, Felix Antonius Wilhelm Ostmann via RT wrote: Show quoted text
> Fri Jan 14 03:31:40 2011: Request 64766 was acted upon. > Transaction: Ticket created by Sadrak > Queue: DBIx-Class-Schema-Loader > Subject: Database schemaname with special chars > Broken in: 0.07002 > Severity: Important > Owner: Nobody > Requestors: felix.ostmann@thewar.de > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=64766> > > > if the schema has a name like "my-schema" the exporter cannot export the > tables from the schema, because sub _tables_list cannot handle it (from > D::C::S::L::DBI). > > in _tables_list are some regex that parse @tables (from the db) which > can be: > > my_schema.my_table > "my-schema".my_table > my_schema."my-table" > "my-schema"."my-table" > > The regex does NOT the correct job! I was not to able to create a > failing test for that :-/ But simple checking that regex can show that > (attached script will print): > > > my_schema.my_table VS my_table > "my-schema".my_table VS my-schema.my_table > my_schema."my-table" VS my-table > "my-schema"."my-table" VS my-table > > > Our schemaname has a minus :-/ > > Perhaps checking a schemaname with a _namesep in it should be a good idear.
fixed in git
Fixed in 0.07011