Author: spadkins
Date: Fri Jan  4 11:09:48 2008
New Revision: 10474

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:
_read_timer(), _get_timer() move, and add newlines on the end of 
import_rows()/export_rows() SQL

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     Fri Jan  4 11:09:48 2008
@@ -15,6 +15,7 @@
 use Date::Format;
 use App::RepositoryObject;
 use App::Reference;
+use Time::HiRes qw(gettimeofday);
 
 =head1 NAME
 
@@ -4356,6 +4357,48 @@
 }
 
 #############################################################################
+# _get_timer()
+#############################################################################
+
+sub _get_timer {
+    my ($self) = @_;
+    my ($seconds_start, $microseconds_start) = gettimeofday;
+    my $timer = { seconds_start => $seconds_start, microseconds_start => 
$microseconds_start };
+    return($timer);
+}
+
+#############################################################################
+# _read_timer()
+#############################################################################
+
+sub _read_timer {
+    my ($self, $timer, $reset) = @_;
+    my ($seconds_finish, $microseconds_finish) = gettimeofday;
+    my $seconds_elapsed           = $seconds_finish      - 
$timer->{seconds_start};
+    my $microseconds_elapsed      = $microseconds_finish - 
$timer->{microseconds_start};
+    if ($microseconds_elapsed < 0) {
+        $microseconds_elapsed += 1000000;
+        $seconds_elapsed      -= 1;
+    }
+    my $time_elapsed = sprintf("%d.%06d", $seconds_elapsed, 
$microseconds_elapsed);
+    if (defined $reset) {
+        # store values. don't reset the timer.
+        if ($reset == 0) {
+            $timer->{seconds_start}      = $seconds_finish;
+            $timer->{microseconds_start} = $microseconds_finish;
+            delete $timer->{time_elapsed};
+        }
+        # reset the timer to be ready for another reading.
+        elsif ($reset) {
+            $timer->{seconds_finish}      = $seconds_finish;
+            $timer->{microseconds_finish} = $microseconds_finish;
+            $timer->{time_elapsed}        = $time_elapsed;
+        }
+    }
+    return($time_elapsed);
+}
+
+#############################################################################
 # DESTROY()
 #############################################################################
 

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 Fri Jan  4 11:09:48 2008
@@ -12,7 +12,6 @@
 @ISA = ( "App::Repository" );
 
 use Data::Dumper;
-use Time::HiRes qw(gettimeofday);
 
 use strict;
 
@@ -689,6 +688,9 @@
         "<"  => "lt",
         ">=" => "ge",
         ">"  => "gt",
+        "=/" => "regexp",
+        "/"  => "regexp",
+        "!/" => "not_regexp",
     );
 
     $where = "";
@@ -2788,40 +2790,6 @@
     &App::sub_exit() if ($App::trace);
 }
 
-sub _get_timer {
-    my ($self) = @_;
-    my ($seconds_start, $microseconds_start) = gettimeofday;
-    my $timer = { seconds_start => $seconds_start, microseconds_start => 
$microseconds_start };
-    return($timer);
-}
-
-sub _read_timer {
-    my ($self, $timer, $reset) = @_;
-    my ($seconds_finish, $microseconds_finish) = gettimeofday;
-    my $seconds_elapsed           = $seconds_finish      - 
$timer->{seconds_start};
-    my $microseconds_elapsed      = $microseconds_finish - 
$timer->{microseconds_start};
-    if ($microseconds_elapsed < 0) {
-        $microseconds_elapsed += 1000000;
-        $seconds_elapsed      -= 1;
-    }
-    my $time_elapsed = sprintf("%d.%06d", $seconds_elapsed, 
$microseconds_elapsed);
-    if (defined $reset) {
-        # store values. don't reset the timer.
-        if ($reset == 0) {
-            $timer->{seconds_start}      = $seconds_finish;
-            $timer->{microseconds_start} = $microseconds_finish;
-            delete $timer->{time_elapsed};
-        }
-        # reset the timer to be ready for another reading.
-        elsif ($reset) {
-            $timer->{seconds_finish}      = $seconds_finish;
-            $timer->{microseconds_finish} = $microseconds_finish;
-            $timer->{time_elapsed}        = $time_elapsed;
-        }
-    }
-    return($time_elapsed);
-}
-
 ######################################################################
 # METADATA REPOSITORY METHODS (implements methods from App::Repository)
 ######################################################################

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       Fri Jan  4 
11:09:48 2008
@@ -644,7 +644,7 @@
             $sql .= "\n   optionally enclosed by '$options->{field_quote}'" if 
($options->{field_quote});
             $sql .= "\n   escaped by '$options->{field_escape}'" if 
($options->{field_escape});
         }
-        $sql .= "\n(" . join(",", @$columns) . ")";
+        $sql .= "\n(" . join(",", @$columns) . ")\n";
         my $context_options = $self->{context}{options};
         my $debug_sql = $context_options->{debug_sql};
         my ($timer, $elapsed_time);
@@ -743,6 +743,7 @@
             $sql .= "\n   optionally enclosed by '$options->{field_quote}'" if 
($options->{field_quote});
             $sql .= "\n   escaped by '$options->{field_escape}'" if 
($options->{field_escape});
         }
+        $sql .= "\n";
         my $context_options = $self->{context}{options};
         my $debug_sql = $context_options->{debug_sql};
         my ($timer, $elapsed_time);

Reply via email to