Back out bdf60588b to disable P::RD grammar precompilation - until P::RD is fixed
Peter Rabbitson [Tue, 7 Feb 2012 10:53:34 +0000 (11:53 +0100)]
While renewed activity on P::RD is great, the downside is that
incompatible changes were introduced which render precompiled
grammars useless. Furthermore since things are currently in the
air it is very likely things will change yet again, hence just
disable the whole thing for the time being. Reference RT#74593

Changes
Makefile.PL
lib/SQL/Translator/Utils.pm
t/60roundtrip.t

diff --git a/Changes b/Changes
index 22dbeba..1929da7 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,4 +1,3 @@
-* All parser grammars are now precompiled for speed
 * Fixes to SQLite foreign keys production (patch from Johan Viklund)
   closes RT#16412, RT#44769
 * ON DELETE/UPDATE actions for SQLite (patch from Lukas Thiemeier)
index 6ebaaff..9ff18bb 100644 (file)
@@ -107,6 +107,8 @@ if ($Module::Install::AUTHOR) {
 WriteAll();
 
 sub _recompile_grammars {
+  return; # disabled until RT#74593 is resolved
+
   require File::Spec;
 
   my $compiled_parser_dir = File::Spec->catdir(qw/
index 86610e4..25f4dc4 100644 (file)
@@ -194,14 +194,25 @@ sub parse_dbms_version {
     }
 }
 
-my ($parsers_libdir, $checkout_dir);
+#my ($parsers_libdir, $checkout_dir);
 sub ddl_parser_instance {
+
     my $type = shift;
 
     # it may differ from our caller, even though currently this is not the case
     eval "require SQL::Translator::Parser::$type"
         or die "Unable to load grammar-spec container SQL::Translator::Parser::$type:\n$@";
 
+    require Parse::RecDescent;
+    return Parse::RecDescent->new(do {
+      no strict 'refs';
+      ${"SQL::Translator::Parser::${type}::GRAMMAR"}
+        || die "No \$SQL::Translator::Parser::${type}::GRAMMAR defined, unable to instantiate PRD parser\n"
+    });
+
+# this is disabled until RT#74593 is resolved
+=begin for general sadness
+
     unless ($parsers_libdir) {
 
         # are we in a checkout?
@@ -259,6 +270,8 @@ sub ddl_parser_instance {
     }
 
     return $precompiled_mod->new;
+=cut
+
 }
 
 # Try to determine the root of a checkout/untar if possible
index 35bda26..836bc1d 100644 (file)
@@ -70,12 +70,13 @@ my $plan = [
     parser_args => {},
     todo => 'Needs volunteers',
   },
-  {
-    engine => 'DB2',
-    producer_args => {},
-    parser_args => {},
-    todo => 'Needs volunteers',
-  },
+# too noisy under new P::RD
+#  {
+#    engine => 'DB2',
+#    producer_args => {},
+#    parser_args => {},
+#    todo => 'Needs volunteers',
+#  },
 
 # There is no Access producer
 #  {