From: Dagfinn Ilmari Mannsåker Date: Fri, 15 Nov 2013 15:03:44 +0000 (+0000) Subject: Fix detection of qualified sequence names for Oracle (RT#90341) X-Git-Tag: 0.07038~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1de9c8e18dde9ef2accda369fe8616c230583eb2;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Fix detection of qualified sequence names for Oracle (RT#90341) --- diff --git a/Changes b/Changes index 8f85e17..6bc73eb 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader - Fix skip count for Oracle multi-schema tests - Actually test data types that require separate tables - Fix national character type sizes on DBD::Oracle >= 1.52 + - Fix detection of qualified sequence names for Oracle (RT#90341) 0.07037 2013-10-30 - Allow overriding individual moniker parts diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm index 2b5c7eb..a3758e5 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm @@ -185,7 +185,7 @@ EOF $sth->execute($table->name, $table->schema); while (my ($trigger_body) = $sth->fetchrow_array) { - if (my ($seq_schema, $seq_name) = $trigger_body =~ /(?:\."?(\w+)"?)?"?(\w+)"?\.nextval/i) { + if (my ($seq_schema, $seq_name) = $trigger_body =~ /(?:"?(\w+)"?\.)?"?(\w+)"?\.nextval/i) { if (my ($col_name) = $trigger_body =~ /:new\.(\w+)/i) { $col_name = $self->_lc($col_name); diff --git a/t/10_05ora_common.t b/t/10_05ora_common.t index 02df8be..74e0e0d 100644 --- a/t/10_05ora_common.t +++ b/t/10_05ora_common.t @@ -182,7 +182,7 @@ my $tester = dbixcsl_common_tests->new( }, ], drop => [qw/oracle_loader_test1 oracle_loader_test9 oracle_loader_test10/], - count => 7 + 30 * 2, + count => 7 + 31 * 2, run => sub { my ($monikers, $classes); ($schema, $monikers, $classes) = @_; @@ -244,7 +244,7 @@ my $tester = dbixcsl_common_tests->new( ) EOF - $dbh1->do($_) for $auto_inc_cb->('oracle_loader_test4', 'id'); + $dbh1->do($_) for $auto_inc_cb->(lc "${schema1}.oracle_loader_test4", 'id'); $dbh1->do("GRANT ALL ON oracle_loader_test4 TO $schema2"); $dbh1->do("GRANT ALL ON oracle_loader_test4_id_seq TO $schema2"); @@ -353,6 +353,9 @@ EOF is try { $rsrc->column_info('id')->{is_auto_increment} }, 1, 'column in schema1'; + is try { $rsrc->column_info('id')->{sequence} }, lc "${schema1}.oracle_loader_test4_id_seq", + 'sequence in schema1'; + is try { $rsrc->column_info('value')->{data_type} }, 'varchar2', 'column in schema1';