From: Peter Rabbitson Date: Tue, 7 Feb 2012 10:53:34 +0000 (+0100) Subject: Back out bdf60588b to disable P::RD grammar precompilation - until P::RD is fixed X-Git-Tag: v0.11011~26 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0eb3b94a54140cedfc37172290f3fc8c1e15ddc9;p=dbsrgits%2FSQL-Translator.git Back out bdf60588b to disable P::RD grammar precompilation - until P::RD is fixed 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 --- diff --git a/Changes b/Changes index 22dbeba..1929da7 100644 --- 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) diff --git a/Makefile.PL b/Makefile.PL index 6ebaaff..9ff18bb 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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/ diff --git a/lib/SQL/Translator/Utils.pm b/lib/SQL/Translator/Utils.pm index 86610e4..25f4dc4 100644 --- a/lib/SQL/Translator/Utils.pm +++ b/lib/SQL/Translator/Utils.pm @@ -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 diff --git a/t/60roundtrip.t b/t/60roundtrip.t index 35bda26..836bc1d 100644 --- a/t/60roundtrip.t +++ b/t/60roundtrip.t @@ -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 # {