5b2a26
From 69db3b0cfccc0687dfbdf56afcfb2f8e536053c6 Mon Sep 17 00:00:00 2001
5b2a26
From: Andrew Dunstan <andrew@dunslane.net>
5b2a26
Date: Sun, 14 May 2017 01:10:18 -0400
5b2a26
Subject: [PATCH] Suppress indentation from Data::Dumper in regression tests
5b2a26
5b2a26
Ultra-modern versions of the perl Data::Dumper module have apparently
5b2a26
changed how they indent output. Instead of trying to keep up we choose
5b2a26
to tell it to supporess all indentation in the hstore_plperl regression
5b2a26
tests.
5b2a26
5b2a26
Backpatch to 9.5 where this feature was introduced.
5b2a26
---
5b2a26
 contrib/hstore_plperl/expected/hstore_plperlu.out | 44 ++++++-----------------
5b2a26
 contrib/hstore_plperl/sql/hstore_plperlu.sql      |  6 ++++
5b2a26
 2 files changed, 17 insertions(+), 33 deletions(-)
5b2a26
5b2a26
diff --git a/contrib/hstore_plperl/expected/hstore_plperlu.out b/contrib/hstore_plperl/expected/hstore_plperlu.out
5b2a26
index b09fb78..d719d29 100644
5b2a26
--- a/contrib/hstore_plperl/expected/hstore_plperlu.out
5b2a26
+++ b/contrib/hstore_plperl/expected/hstore_plperlu.out
5b2a26
@@ -20,15 +20,12 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
 SELECT test1('aa=>bb, cc=>NULL'::hstore);
5b2a26
-INFO:  $VAR1 = {
5b2a26
-          'aa' => 'bb',
5b2a26
-          'cc' => undef
5b2a26
-        };
5b2a26
-
5b2a26
+INFO:  $VAR1 = {'aa' => 'bb','cc' => undef};
5b2a26
  test1 
5b2a26
 -------
5b2a26
      2
5b2a26
@@ -39,12 +36,12 @@ LANGUAGE plperlu
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
 SELECT test1none('aa=>bb, cc=>NULL'::hstore);
5b2a26
 INFO:  $VAR1 = '"aa"=>"bb", "cc"=>NULL';
5b2a26
-
5b2a26
  test1none 
5b2a26
 -----------
5b2a26
          0
5b2a26
@@ -56,15 +53,12 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
 SELECT test1list('aa=>bb, cc=>NULL'::hstore);
5b2a26
-INFO:  $VAR1 = {
5b2a26
-          'aa' => 'bb',
5b2a26
-          'cc' => undef
5b2a26
-        };
5b2a26
-
5b2a26
+INFO:  $VAR1 = {'aa' => 'bb','cc' => undef};
5b2a26
  test1list 
5b2a26
 -----------
5b2a26
          2
5b2a26
@@ -77,18 +71,12 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]->[0], $_[0]->[1]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
 SELECT test1arr(array['aa=>bb, cc=>NULL'::hstore, 'dd=>ee']);
5b2a26
-INFO:  $VAR1 = {
5b2a26
-          'aa' => 'bb',
5b2a26
-          'cc' => undef
5b2a26
-        };
5b2a26
-$VAR2 = {
5b2a26
-          'dd' => 'ee'
5b2a26
-        };
5b2a26
-
5b2a26
+INFO:  $VAR1 = {'aa' => 'bb','cc' => undef};$VAR2 = {'dd' => 'ee'};
5b2a26
  test1arr 
5b2a26
 ----------
5b2a26
         2
5b2a26
@@ -101,6 +89,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 
5b2a26
 $rv = spi_exec_query(q{SELECT 'aa=>bb, cc=>NULL'::hstore AS col1});
5b2a26
 elog(INFO, Dumper($rv->{rows}[0]->{col1}));
5b2a26
@@ -111,13 +100,8 @@ $rv = spi_exec_prepared($plan, {}, $val);
5b2a26
 elog(INFO, Dumper($rv->{rows}[0]->{col1}));
5b2a26
 $$;
5b2a26
 SELECT test3();
5b2a26
-INFO:  $VAR1 = {
5b2a26
-          'aa' => 'bb',
5b2a26
-          'cc' => undef
5b2a26
-        };
5b2a26
-
5b2a26
+INFO:  $VAR1 = {'aa' => 'bb','cc' => undef};
5b2a26
 INFO:  $VAR1 = '"a"=>"1", "b"=>"boo", "c"=>NULL';
5b2a26
-
5b2a26
  test3 
5b2a26
 -------
5b2a26
  
5b2a26
@@ -138,6 +122,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_TD->{new}));
5b2a26
 if ($_TD->{new}{a} == 1) {
5b2a26
     $_TD->{new}{b} = {a => 1, b => 'boo', c => undef};
5b2a26
@@ -147,14 +132,7 @@ return "MODIFY";
5b2a26
 $$;
5b2a26
 CREATE TRIGGER test4 BEFORE UPDATE ON test1 FOR EACH ROW EXECUTE PROCEDURE test4();
5b2a26
 UPDATE test1 SET a = a;
5b2a26
-INFO:  $VAR1 = {
5b2a26
-          'a' => '1',
5b2a26
-          'b' => {
5b2a26
-                 'aa' => 'bb',
5b2a26
-                 'cc' => undef
5b2a26
-               }
5b2a26
-        };
5b2a26
-
5b2a26
+INFO:  $VAR1 = {'a' => '1','b' => {'aa' => 'bb','cc' => undef}};
5b2a26
 SELECT * FROM test1;
5b2a26
  a |                b                
5b2a26
 ---+---------------------------------
5b2a26
diff --git a/contrib/hstore_plperl/sql/hstore_plperlu.sql b/contrib/hstore_plperl/sql/hstore_plperlu.sql
5b2a26
index 8d8508c..c714b35 100644
5b2a26
--- a/contrib/hstore_plperl/sql/hstore_plperlu.sql
5b2a26
+++ b/contrib/hstore_plperl/sql/hstore_plperlu.sql
5b2a26
@@ -15,6 +15,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
@@ -26,6 +27,7 @@ LANGUAGE plperlu
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
@@ -38,6 +40,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
@@ -52,6 +55,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_[0]->[0], $_[0]->[1]));
5b2a26
 return scalar(keys %{$_[0]});
5b2a26
 $$;
5b2a26
@@ -66,6 +70,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 
5b2a26
 $rv = spi_exec_query(q{SELECT 'aa=>bb, cc=>NULL'::hstore AS col1});
5b2a26
 elog(INFO, Dumper($rv->{rows}[0]->{col1}));
5b2a26
@@ -90,6 +95,7 @@ TRANSFORM FOR TYPE hstore
5b2a26
 AS $$
5b2a26
 use Data::Dumper;
5b2a26
 $Data::Dumper::Sortkeys = 1;
5b2a26
+$Data::Dumper::Indent = 0;
5b2a26
 elog(INFO, Dumper($_TD->{new}));
5b2a26
 if ($_TD->{new}{a} == 1) {
5b2a26
     $_TD->{new}{b} = {a => 1, b => 'boo', c => undef};
5b2a26
-- 
5b2a26
2.1.4