Author: spadkins
Date: Sun Feb 22 16:14:54 2009
New Revision: 12527
Modified:
p5ee/trunk/App-Repository/lib/App/Repository.pm
p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm
Log:
added some trace statements
Modified: p5ee/trunk/App-Repository/lib/App/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository.pm Sun Feb 22 16:14:54 2009
@@ -1993,7 +1993,7 @@
}
else {
@values = $self->_key_to_values($key);
- die "ERROR: values [$key] do not match columns [" .
join(",",@$primary_key) . "] in primary key"
+ die "ERROR: values [$key] on $table table do not match columns ["
. join(",",@$primary_key) . "] in primary key"
if ($#$primary_key != $#values);
for ($colnum = 0; $colnum <= $#$primary_key; $colnum++) {
$params{$primary_key->[$colnum]} = $values[$colnum];
Modified: p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm Sun Feb 22 16:14:54 2009
@@ -3175,14 +3175,17 @@
}
sub _last_inserted_id {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
my $id = $self->{last_inserted_id} || die "No recently inserted id is
available";
delete $self->{last_inserted_id};
+ &App::sub_exit($id) if ($App::trace);
return($id);
}
# $pk_idx = $rep->_key_idx($table, \...@cols, \...@key_cols);
sub _key_idx {
+ &App::sub_entry if ($App::trace);
my $self = shift;
my ($table, $cols, $key_cols) = @_;
@@ -3218,32 +3221,41 @@
}
}
}
+ &App::sub_exit($key_idx) if ($App::trace);
return($key_idx);
}
sub _get_tables_from_source {
+ &App::sub_entry if ($App::trace);
my ($self) = @_;
my $dbh = $self->{dbh};
my @tables = map {lc} grep(s/^[^.]+\.//, grep(s/['"`]//g,
$dbh->tables("%","%","%","TABLE,VIEW")));
+ &App::sub_exit(@tables) if ($App::trace);
return(@tables);
}
sub _get_primary_key_from_source {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
my $dbh = $self->{dbh};
my $primary_key = [ map {lc} $dbh->primary_key("%", "%", $table) ];
+ &App::sub_exit($primary_key) if ($App::trace);
return($primary_key);
}
sub _get_alternate_keys_from_source {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
my $alternate_keys = [];
+ &App::sub_exit($alternate_keys) if ($App::trace);
return($alternate_keys);
}
sub _column_metadata_specifiers {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
# catalog, schema, table, column
+ &App::sub_exit("%", "%", $table, "%") if ($App::trace);
return("%", "%", $table, "%");
}
Modified: p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm Sun Feb 22
16:14:54 2009
@@ -768,20 +768,25 @@
}
sub _get_tables_from_source {
+ &App::sub_entry if ($App::trace);
my ($self) = @_;
my $dbh = $self->{dbh};
my @tables = map {lc} grep(s/^[^.]+\.//, grep(s/['"`]//g,
$dbh->tables(undef,$self->{dbname},"%","TABLE,VIEW")));
+ &App::sub_exit(@tables) if ($App::trace);
return(@tables);
}
sub _get_primary_key_from_source {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
my $dbh = $self->{dbh};
my $primary_key = [ map {lc} $dbh->primary_key(undef, $self->{dbname},
$table) ];
+ &App::sub_exit($primary_key) if ($App::trace);
return($primary_key);
}
sub _get_alternate_keys_from_source {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
my $alternate_keys = [];
my $alternate_keys_by_name = {};
@@ -804,12 +809,15 @@
}
}
}
+ &App::sub_exit($alternate_keys) if ($App::trace);
return($alternate_keys);
}
sub _column_metadata_specifiers {
+ &App::sub_entry if ($App::trace);
my ($self, $table) = @_;
# catalog, schema, table, column
+ &App::sub_exit(undef, $self->{dbname}, $table, "%") if ($App::trace);
return(undef, $self->{dbname}, $table, "%");
}